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 n
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.