Please note that I did not write this code: I only packaged it up to make it easier to install. This code is all taken from the mod_wsgi wiki page on SourceCodeReloading, and was written by Graham Dumpleton.
Since mod_wsgi is released under the Apache License 2.0, I have assumed that this code is also available under that license, as it is part of the same repository.
pip install wsgi-monitor
or download the package, and install with:
python setup.py install
Hopefully, you are using this inside a virtualenv.
If you use mod_passenger, then add something like the following to the bottom of your passenger_wsgi.py file:
if settings.DEBUG: import wsgi_monitor wsgi_monitor.start(interval=1.0)
This particular version assumes that settings.DEBUG is the flag that determines if we are running in development mode, and reload should be on. This works great with Django, but your system may require something different. If you use this with another framework or web server, please contribute by forking this on bitbucket (wsgi-monitor) and updating the docs.