Skip to content
Myr

More doc updates for FLASK_APP

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent a7d829c · Browse files · 1 file+9 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−7 removed

  • other:+9 added−7 removed

1 file+9 added−7 removed

modified:docs/server.rst+9 added-7 removed
14 unmodified lines
15The :command:`flask` command line script (:ref:`cli`) is strongly recommended for16development because it provides a superior reload experience due to how it17loads the application. The basic usage is like this::1819 $ flask -a my_application --debug run19 $ export FLASK_APP=my_application20 $ export FLASK_DEBUG=121 $ flask run2223This will enable the debugger, the reloader and then start the server on24*http://localhost:5000/*.2526The individual features of the server can be controlled by passing more27arguments to the ``run`` option. For instance the reloader can be28disabled::2928 $ flask -a my_application --debug run --no-reload30 $ flask run --no-reload3132In Code33-------34
6 unmodified lines
41 if __name__ == '__main__':42 app.run()4344This works well for the common case but it does not work well for43development which is why from Flask 1.0 onwards the :command:`flask` method is44recommended. The reason for this is that due to how the reload mechanism45works there are some bizarre side-effects (like executing certain code46twice, sometimes crashing without message or dying when a syntax or47import error happens).45development which is why from Flask 0.11 onwards the :command:`flask`46method is recommended. The reason for this is that due to how the reload47mechanism works there are some bizarre side-effects (like executing48certain code twice, sometimes crashing without message or dying when a49syntax or import error happens).5051It is however still a perfectly valid method for invoking a non automatic52reloading application.