Fix #2897 - Add extra_files option to flask run CLI

This commit is contained in:
Bruno Rocha 2018-08-31 19:06:20 -03:00 committed by David Lord
parent 4fe81d7c62
commit 2308cba407
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
3 changed files with 23 additions and 2 deletions

View file

@ -202,6 +202,20 @@ command, instead of ``flask run --port 8000``:
These can be added to the ``.flaskenv`` file just like ``FLASK_APP`` to
control default command options.
To define a list of files the reloader should watch additionally to the modules
as in ``extra_files`` argument used in the ``app.run`` and ``werkzeug.serving.run_simple``
you can either use the ``--extra-files`` (or multiple ``-f``) option or define the
``FLASK_RUN_EXTRA_FILES`` environment variable.
.. code-block:: none
# on windows use ``;`` instead of ``:`` to separate paths
export FLASK_RUN_EXTRA_FILES=/path/to/file1:/path/to/file2
flask run
* Running on http://127.0.0.1:8000/
* Detected change in '/path/to/file1', reloading
On command line the same can be achieved with ``flask run -f /path/to/file1 -f /path/to/file2``.
Disable dotenv
~~~~~~~~~~~~~~