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

@ -12,12 +12,13 @@ but you can also continue using the :meth:`Flask.run` method.
Command Line
------------
The :command:`flask` command line script (:ref:`cli`) is strongly recommended for
development because it provides a superior reload experience due to how it
loads the application. The basic usage is like this::
The :command:`flask` command line script (:ref:`cli`) is strongly
recommended for development because it provides a superior reload
experience due to how it loads the application. The basic usage is like
this::
$ export FLASK_APP=my_application
$ export FLASK_DEBUG=1
$ export FLASK_ENV=development
$ flask run
This will enable the debugger, the reloader and then start the server on
@ -29,6 +30,13 @@ disabled::
$ flask run --no-reload
.. note::
On older Flask version (before 1.0) the :envvar:`FLASK_ENV`
environment variable is not supported and you need to enable the
debug mode separately by setting the :envvar:`FLASK_DEBUG` environment
variable to ``1``.
In Code
-------