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

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

问题描述

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

I configured my development server this way:

Ubuntu、Apache、mod_wsgi、Python 2.6

Ubuntu, Apache, mod_wsgi, Python 2.6

我通过连接到服务器的另一台计算机在服务器上工作.

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

大多数情况下,除非我重新启动 Apache,否则更改不会影响应用程序.在某些情况下,更改无需重新启动网络服务器即可生效,但假设加载 3 或 4 个页面后,应用程序的行为可能与更改前的行为相同.

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.

直到现在,我每次都重新加载 apache,因为我在这里有开发服务器,但是过了一段时间就变得很烦人了.我怎样才能避免这种情况?

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.

谢谢

推荐答案

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

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 + 阿帕奇 &mod_wsgi:更改后必须重新启动 apache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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