|
|
@ -16,7 +16,9 @@ The :command:`flask` command line script (:ref:`cli`) is strongly recommended fo |
|
|
|
development because it provides a superior reload experience due to how it |
|
|
|
development because it provides a superior reload experience due to how it |
|
|
|
loads the application. The basic usage is like this:: |
|
|
|
loads the application. The basic usage is like this:: |
|
|
|
|
|
|
|
|
|
|
|
$ flask -a my_application --debug run |
|
|
|
$ export FLASK_APP=my_application |
|
|
|
|
|
|
|
$ export FLASK_DEBUG=1 |
|
|
|
|
|
|
|
$ flask run |
|
|
|
|
|
|
|
|
|
|
|
This will enable the debugger, the reloader and then start the server on |
|
|
|
This will enable the debugger, the reloader and then start the server on |
|
|
|
*http://localhost:5000/*. |
|
|
|
*http://localhost:5000/*. |
|
|
@ -25,7 +27,7 @@ The individual features of the server can be controlled by passing more |
|
|
|
arguments to the ``run`` option. For instance the reloader can be |
|
|
|
arguments to the ``run`` option. For instance the reloader can be |
|
|
|
disabled:: |
|
|
|
disabled:: |
|
|
|
|
|
|
|
|
|
|
|
$ flask -a my_application --debug run --no-reload |
|
|
|
$ flask run --no-reload |
|
|
|
|
|
|
|
|
|
|
|
In Code |
|
|
|
In Code |
|
|
|
------- |
|
|
|
------- |
|
|
@ -40,11 +42,11 @@ Example:: |
|
|
|
app.run() |
|
|
|
app.run() |
|
|
|
|
|
|
|
|
|
|
|
This works well for the common case but it does not work well for |
|
|
|
This works well for the common case but it does not work well for |
|
|
|
development which is why from Flask 1.0 onwards the :command:`flask` method is |
|
|
|
development which is why from Flask 0.11 onwards the :command:`flask` |
|
|
|
recommended. The reason for this is that due to how the reload mechanism |
|
|
|
method is recommended. The reason for this is that due to how the reload |
|
|
|
works there are some bizarre side-effects (like executing certain code |
|
|
|
mechanism works there are some bizarre side-effects (like executing |
|
|
|
twice, sometimes crashing without message or dying when a syntax or |
|
|
|
certain code twice, sometimes crashing without message or dying when a |
|
|
|
import error happens). |
|
|
|
syntax or import error happens). |
|
|
|
|
|
|
|
|
|
|
|
It is however still a perfectly valid method for invoking a non automatic |
|
|
|
It is however still a perfectly valid method for invoking a non automatic |
|
|
|
reloading application. |
|
|
|
reloading application. |
|
|
|