Apache Django Mod_Wsgi - 自动重新加载 [英] Apache Django Mod_Wsgi - auto reload
问题描述
我想知道在以下文章中引用的代码在哪里添加:
< a href =http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode =nofollow noreferrer> http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
def _restart(path):
_queue.put(True)
prefix ='monitor =%d):'%os.getpid()
print>> sys.stderr,'%s检测到更改为\'%s\''%(前缀,路径)
print>> sys.stderr,'%s触发Apache重新启动'%前缀
import ctypes
ctypes.windll.libhttpd.ap_signal_parent(1)
阅读:
http://blog.dscpl.com.au/2008/12/using-modwsgi-when -developing-django.html
当使用Django时,它会告诉你确切的放置文件的位置。您只需要在与Windows相关的源代码重新加载文档部分中更改每个人都指向的代码。另请阅读:
http://blog.dscpl.com.au/2009/02/source-code-reloading-with-modwsgi-on.html
解释了首先与Windows相关的变体。
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)
Read:
http://blog.dscpl.com.au/2008/12/using-modwsgi-when-developing-django.html
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
which explains the variations on the first related to Windows.
这篇关于Apache Django Mod_Wsgi - 自动重新加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!