title: Apache Django Mod_Wsgi - auto reload
body: <p>I am trying to auto reload my django app which uses apache + mod_wsgi on my local windows machine. </p>
  
  <p>I'd like to know where do I add this code that's referenced in the following article:</p>
  
  <p><a href="http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode" rel="noreferrer">http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode</a></p>
  
  <pre><code>def _restart(path):
      _queue.put(True)
      prefix = 'monitor (pid=%d):' % os.getpid()
      print &gt;&gt; sys.stderr, '%s Change detected to \'%s\'.' % (prefix, path)
      print &gt;&gt; sys.stderr, '%s Triggering Apache restart.' % prefix
      import ctypes
      ctypes.windll.libhttpd.ap_signal_parent(1)
  </code></pre>