By default, when running Flask application using the built-in server (Flask.run), it monitors its Python files and automatically reloads the app if its code cha
Updated as of June 2019:
The flask CLI is recommended over app.run() for running a dev server, so if we want to use the CLI then the accepted solution can't be used.
Using the development version of Flask (1.1) as of this writing allows us to set an environment variable FLASK_RUN_EXTRA_FILES which effectively does the same thing as the accepted answer.
See this github issue.
Example usage:
export FLASK_RUN_EXTRA_FILES="app/templates/index.html"
flask run
in Linux. To specify multiple extra files, separate file paths with colons., e.g.
export FLASK_RUN_EXTRA_FILES="app/templates/index.html:app/templates/other.html"
The CLI also supports an --extra-files argument as of Flask 1.1.