Apache Django Mod_Wsgi - 自动重新加载 [英] Apache Django Mod_Wsgi - auto reload
问题描述
我正在尝试自动重新加载我的 django 应用程序,该应用程序在我的本地 Windows 机器上使用 apache + mod_wsgi.
I am trying to auto reload my django app which uses apache + mod_wsgi on my local windows machine.
我想知道在哪里添加以下文章中引用的代码:
I'd like to know where do I add this code that's referenced in the following article:
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)
推荐答案
阅读:
http://blog.dscpl.com.au/2008/12/using-modwsgi-when-developing-django.html
它会告诉您在使用 Django 时放置文件的确切位置.您只需要更改每个人都在与 Windows 相关的源代码重新加载文档部分中向您指出的代码更改.另请阅读:
It tells you exactly where to place the file when using Django. You just need to make the code change that everyone is pointing out to you in the source code reloading documentation section related to Windows. Also read:
http://blog.dscpl.com.au/2009/02/source-code-reloading-with-modwsgi-on.html
它解释了第一个与 Windows 相关的变化.
which explains the variations on the first related to Windows.
这篇关于Apache Django Mod_Wsgi - 自动重新加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!