I am testing this using Bitnami DjangoStack http://bitnami.org/stack/djangostack and Windows XP installed on D: \ BitNami DjangoStack and C: \ Documents and Settings \ tsurahman \ BitNami DjangoStack \ myproject projects as a project directory (installation by default)
as in http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode#Restarting_Apache_Processes , I added
MaxRequestsPerChild 1
in file D: \ BitNami DjangoStack \ apps \ django \ conf \ django.conf see Graham Dumpleton's comment
then I created a monitor.py file in my project directory with content, as in http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode#Monitoring_For_Code_Changes and replace the _restart method http://code.google.com/p / modwsgi / wiki / ReloadingSourceCode # Restarting_Windows_Apache , here is the script part
.... _running = False _queue = Queue.Queue() _lock = threading.Lock() def _restart(path): _queue.put(True) prefix = 'monitor (pid=%d):' % os.getpid() print >> sys.stderr, '%s Change detected to \'%s\'.' % (prefix, path) print >> sys.stderr, '%s Triggering Apache restart.' % prefix import ctypes ctypes.windll.libhttpd.ap_signal_parent(1) def _modified(path): try: ....
and in the file D: \ BitNami DjangoStack \ apps \ django \ scripts \ django.wsgi ,
.... import django.core.handlers.wsgi import monitor monitor.start(interval=1.0) monitor.track(os.path.join(os.path.dirname(__file__), 'site.cf')) application = django.core.handlers.wsgi.WSGIHandler()
and then restart the apache server
source share