2

I have a django site running in apache/mod_wsgi. Every time after updating the code I need restart apache manually.

mod_wsgi provide a method to do it: http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode which I think is, kind of, not so decent.

So my question is: is there a simpler and more decent way to do it? Such as an apache mod which monitor the files' status or something else. If there's not, is it possible to write an apache mod to do it?

zchenah
  • 2,060
  • 16
  • 30
  • What are you expecting by the way of 'simpler and more decent way'? There is really only one way of doing this and it needs to be done from within the Python interpreter where it has knowledge of which files are in use by the application. Any external module isn't going to know what is used and could only monitor a particular part of the filesystem and in doing that would restart on any file change and not just those loaded by the application. You really need to explain why the way given isn't suitable. – Graham Dumpleton Dec 12 '11 at 11:49
  • @GrahamDumpleton Such as, the mod_wsgi way use an explicit thread to do this. So when the server restart depends on the time interval set in advance and the thread schedule, but not when the new request comes. And this way cannot know which particular part trigger the restart neither, you have to specify which or what kinds of file need to be monitored. – zchenah Dec 12 '11 at 13:34
  • With the monitor script you don't need to tell it what .py files to monitor, it works it out from what is loaded in sys.modules. The time interval isn't usually an issue because you are only meant to use this for development and NOT production. Why is it being time interval based a problem? – Graham Dumpleton Dec 12 '11 at 20:41

0 Answers0