forked from orbit-oss/flask
Add Support for FLASK_ENV (#2570)
This introduces environments to Flask
This commit is contained in:
parent
60eecb547d
commit
2433522d29
10 changed files with 151 additions and 71 deletions
|
|
@ -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
|
||||
-------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue