我正在尝试自动重新加载我的django应用程序,该应用程序在我的本地Windows机器上使用apache + mod_wsgi.
我想知道在哪里添加以下文章中引用的代码:
http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
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)
Run Code Online (Sandbox Code Playgroud)