apache mod_wsgi autoreload
Thursday, September 2nd, 2010各种nix下的参考mod_wsgi的wiki
win32平台的修改 _restart 方法
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 process restart.' % prefix
if sys.platform == 'win32':
#win32
import ctypes
ctypes.windll.libhttpd.ap_signal_parent(1)
else:
# nix
os.kill(os.getpid(), signal.SIGINT)