Apache Django Mod_Wsgi - 自动重新加载 [英] Apache Django Mod_Wsgi - auto reload

查看:111
本文介绍了Apache Django Mod_Wsgi - 自动重新加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试自动重新加载我的本地Windows机器上使用apache + mod_wsgi的django应用程序。



我想知道在以下文章中引用的代码在哪里添加:



< 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆