在 Apache 上使用 Django 和 mod_wsgi 时必须重新启动 Apache
我正在使用 Django 创建一个网络应用程序。由于我非常熟悉 Apache,因此我设置了开发环境,让 Django 使用 mod_wsgi 通过 Apache 运行。我对此唯一的烦恼是每次更改代码时都必须重新启动 Apache。有办法解决这个问题吗?
I'm creating a web app with Django. Since I'm very familiar with Apache I setup my development environment to have Django run through Apache using mod_wsgi. The only annoyance I have with this is that I have to restart Apache everytime I change my code. Is there a way around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
mod_wsgi 非常适合生产,但我认为附带的服务器更适合开发。
无论如何,您应该阅读这篇有关自动重新加载源代码的内容。
mod_wsgi is great for production but I think the included server is better for development.
Anyway you should read this about automatic reloading of source code.
我觉得这确实只是大多数人处理的事情之一。这确实没什么大不了的。我制作了一个 bash 脚本来使这尽可能简单。我将其命名为“ra”(重新加载 apache),因此它又短又快。以下内容适用于大多数 apache 安装(在基于 UNIX 的系统上):
您可能可以使用某种工具将其绑定到快捷键/脚踏板/cron。
I feel like this is really just one of those things most people deal with. It's really not that big of a deal. I made a bash script to make this as easy as possible. I name it 'ra' (reload apache) so it's short and quick. The following works for most apache installs (on UNIX-based systems):
You could probably use some kind of tool to bind this to a key shortcut/foot pedeal/cron.