在 Apache 上使用 Django 和 mod_wsgi 时必须重新启动 Apache

发布于 2024-08-24 01:29:37 字数 133 浏览 7 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

世界等同你 2024-08-31 01:29:37

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.

债姬 2024-08-31 01:29:37

我觉得这确实只是大多数人处理的事情之一。这确实没什么大不了的。我制作了一个 bash 脚本来使这尽可能简单。我将其命名为“ra”(重新加载 apache),因此它又短又快。以下内容适用于大多数 apache 安装(在基于 UNIX 的系统上):

#!/bin/bash
sudo /etc/init.d/apache2 reload

您可能可以使用某种工具将其绑定到快捷键/脚踏板/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):

#!/bin/bash
sudo /etc/init.d/apache2 reload

You could probably use some kind of tool to bind this to a key shortcut/foot pedeal/cron.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文