Add Support for FLASK_ENV (#2570)

This introduces environments to Flask
This commit is contained in:
Armin Ronacher 2018-01-06 17:07:56 +01:00 committed by GitHub
parent 60eecb547d
commit 2433522d29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 151 additions and 71 deletions

View file

@ -130,13 +130,16 @@ That is not very nice and Flask can do better. If you enable debug
support the server will reload itself on code changes, and it will also
provide you with a helpful debugger if things go wrong.
To enable debug mode you can export the ``FLASK_DEBUG`` environment variable
To enable all development features (and to disable the debug mode) you can
export the ``FLASK_ENV`` environment variable and set it to
``development``
before running the server::
$ export FLASK_DEBUG=1
$ export FLASK_ENV=development
$ flask run
(On Windows you need to use ``set`` instead of ``export``).
(On Windows you need to use ``set`` instead of ``export`` and on Flask
versions older than 1.0 you need to export ``FLASK_DEBUG=1`` instead).
This does the following things: