阿帕奇的Django的mod_wsgi - 自动重载 [英] Apache Django Mod_Wsgi - auto reload

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

问题描述

我试图自动加载它使用的Apache + mod_wsgi的我的本地Windows机器上我的Django应用程序。

我想知道我在哪里添加此code,它的下面的文章中引用:

HTTP://$c$c.google。 COM / p / modwsgi /维基/ ReloadingSource code

 高清_restart(路径):
    _queue.put(真)
    preFIX ='显示器(PID =%d个):'%os.getpid()
    打印>> sys.stderr来的,'%s的变化检测到\\'%s的\\'。 %(preFIX,路径)
    打印>> sys.stderr来的,'%s的触发Apache的重新启动。 %preFIX
    进口ctypes的
    ctypes.windll.libhttpd.ap_signal_parent(1)


解决方案

阅读:

HTTP://blog.dscpl。 com.au/2008/12/using-modwsgi-when-developing-django.html

它告诉你究竟在何处使用Django时,置入的文件。你只需要做出code的变化,每个人都在源$ C ​​$ C重装与Windows文档部分指出你。另请阅读:

的http:/ /blog.dscpl.com.au/2009/02/source-$c$c-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.

这篇关于阿帕奇的Django的mod_wsgi - 自动重载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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