Skip to content

Commit afa33e3

Browse files
committed
Merge pull request pallets#800 from nZac/issue#783
cleared up confusion for from_envvar in docs
2 parents c541f7e + 5ace060 commit afa33e3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/tutorial/setup.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ string it will import it) and then look for all uppercase variables
3737
defined there. In our case, the configuration we just wrote a few lines
3838
of code above. You can also move that into a separate file.
3939

40-
Usually, it is a good idea to load a configuration from a configurable
41-
file. This is what :meth:`~flask.Config.from_envvar` can do, replacing the
42-
:meth:`~flask.Config.from_object` line above::
43-
40+
Usually, it is a good idea to load a separate, environment specific
41+
configuration file. Flask allows you to import multiple configurations and it
42+
will use the setting defined in the last import. This enables robust
43+
configuration setups. :meth:`~flask.Config.from_envvar` can help achieve this.
44+
4445
app.config.from_envvar('FLASKR_SETTINGS', silent=True)
4546

46-
That way someone can set an environment variable called
47-
:envvar:`FLASKR_SETTINGS` to specify a config file to be loaded which will then
48-
override the default values. The silent switch just tells Flask to not complain
47+
Simply define the environment variable :envvar:`FLASKR_SETTINGS` that points to
48+
a config file to be loaded. The silent switch just tells Flask to not complain
4949
if no such environment key is set.
5050

5151
The `secret_key` is needed to keep the client-side sessions secure.

0 commit comments

Comments
 (0)