Flask does not reload modified code when running under WSL
See original GitHub issueI am developing a Flask app on a Linux machine, which does correctly reload itself when I modify a Python source code file (when running in debug mode). Sometimes though I need to develop on a Windows machine, using WSL, but the very same Flask app sources. That basically works fine, however, under WSL the auto-reload feature does not seem to work any more. I can change the Python sources, but nothing happens - I need to manually shutdown and restart the Flask server.
Is this a known bug under WSL? Do I need to start the Flask application in a certain way?
As reference, here is how I start the application under VS Code:
"configurations": [
{
"name": "Run Server",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "run.py",
"FLASK_ENV": "development",
},
"args": [
"run"
],
}
]
… which starts the the Flask appliacation under WSL with these output:
* Serving Flask app "run.py" (lazy loading)
* Environment: development
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with inotify reloader
* Debugger is active!
* Debugger PIN: 182-804-918
That output looks fine to me, but still no auto-reload.
Any ideas?
Environment
- Python version: 3.8.2 64-bit (from Ubuntu on WSL)
- Flask version: 1.1.2
- Werkzeug version: 1.0.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
That solved my issue, after uninstalling
watchdog
auto-reloading worked now, thanks!nevermind, i somehow thought this option existed but apparently there’s only
--reload/--no-reload
…