我正在尝试自动重新加载我的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)