lighttpd django fastcgi and auto-reloading?
I'm wondering if anyone has ever gotten fcgi to auto-reload with this setup? this to work? I have tried implementing a reload mechanism using django's autoreload.py (copying it to my own location and calling autoreload.main(start开发者_JS百科), unfortunately, I get errors when the fork occurs like:
django/core/servers/fastcgi.py", line 180,
in runfastcgi WSGIServer(WSGIHandler(), **wsgi_opts).run()
File "build/bdist.freebsd-6.4-RELEASE-p9-amd64/egg/flup/server/fcgi_fork.py", line 140,
in run
File "build/bdist.freebsd-6.4-RELEASE-p9-amd64/egg/flup/server/preforkserver.py", line 119,
in run
File "build/bdist.freebsd-6.4-RELEASE-p9-amd64/egg/flup/server/preforkserver.py", line 450,
in _installSignalHandlers ValueError: signal only works in main thread
My ideal setup would be to be able to reload/kill my fcgi process and start a new one after each time a code change is detected, similar to how django does this with their internal server. I also tried removing the threading from autoreload.py that would get past this error, but it does not seem to run the server properly (still investigating that).
Perhaps someone has tried CherryPies autoreload.py in the settings.py file for django?
I got this to work using this technique: http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode Using the monitor script, running it just before I load my fastcgi process and a little help from supervisord make this work.
精彩评论