Flask + mod_wsgi automatic reload on source code change
flask, wsgi
Solution
With `mod_wsgi`, `WSGIScriptReloading` looks for changes to the `.wsgi` config file, rather than the code.
My workflow is to upload my code changes then just
$ touch MyWebApp.wsgi
which causes the last modified file timestamp to change and `mod_wsgi` to reload the code.
You can do this 'remotely' by saving the `.wsgi` file on your local machine and then uploading it again, or I just do it via SSH.
Not a lot you can do about syntax errors, the code is either running or it isn't, but a fix plus a `touch` will get it running again.
One gotcha to look out for if you're working via FTP: make sure you upload the 'touched' `.wsgi` file last otherwise it'll try and start with the wrong code.
Problem
Does anyone know how to make a `mod_wsgi` automatically reload a Flask app when any of the modules changes? I've tried `WSGIScriptReloading On`, but no luck. The official documentation is kind of a bear ... I guess I'll give it a stab if no one knows. Thanks in advance! Also, if it could not permanently crash on syntax errors (like the the Flask reloader), that'd be awesome.