Django + apache& mod_wsgi:更改后必须重新启动apache [英] Django + apache & mod_wsgi: having to restart apache after changes

查看:120
本文介绍了Django + apache& mod_wsgi:更改后必须重新启动apache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以这种方式配置了我的开发服务器:



Ubuntu,Apache,mod_wsgi,Python 2.6



在连接到其他计算机的服务器上工作。



大多数时候,更改不会影响应用程序,除非我重新启动Apache。
在某些情况下,更改生效,而不重新启动网络服务器,但是在我们说3或4页面加载之后,应用程序可能会像以前在更改之前的行为一样。



到目前为止,我刚刚重新加载apache,因为我有开发服务器在这里与我,但HELL过了一会儿这么烦人。我如何避免这种情况?



我无法使用开发服务器,因为我需要一个尽可能靠近生产环境的环境。



感谢

解决方案

我的建议是以守护进程运行应用程序。
这样你不需要重新启动apache,
只需 touch my_handler.wsgi ,守护程序将知道重新启动该应用程序。 apache httpd不会只是你的(在生产中),所以在每次更新时都不要重新启动它。


I configured my development server this way:

Ubuntu, Apache, mod_wsgi, Python 2.6

I work on the server from another computer connected to it.

Most of the times the changes don't affect the application unless I restart Apache. In some cases the changes take effect without restarting the webserver, but after let's say 3 or 4 page loads the application might behave like it used to behave previous to the changes.

Until now I just reloaded everytime apache as I have the development server here with me, but HELL after a while got so annoying. How can I avoid this?

I can't work with the development server as I need an environment that is as close as possible as the production one.

Thanks

解决方案

My suggestion is that you run the application in daemon mode. This way you won't be required to restart apache, just touch my_handler.wsgi and the daemon will know to restart the app. The apache httpd will not be only yours (in production) so it is fair not to restart it on every update.

这篇关于Django + apache& mod_wsgi:更改后必须重新启动apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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