【发布时间】:2016-09-03 01:39:38
【问题描述】:
我构建了一个 django-project 并使用 Apache-WSGI 组合将其部署到生产环境中。为此,我添加了 apache2.conf如下图:
WSGIScriptAlias / /home/ubuntu/MyProject/MyProject/wsgi.py
WSGIPythonPath /home/ubuntu/MyProject
<Directory /home/ubuntu/MyProject/MyProject>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
所以这意味着并不是所有对我网站的请求都首先转到 Apache,然后才允许 WSGI 发挥作用。因此,如果我关闭 Apache,网站将无法运行。
我现在已经安装了 Django-Channels。根据文档 (https://channels.readthedocs.io/en/latest/deploying.html) 中的“部署”部分,我有:
- 已安装 Redis(在我的 Django 项目服务器上)
- 运行工作服务器
- 运行 Daphne(接口服务器)
- 我目前已停止 Apache,网站拒绝连接。
【问题讨论】:
标签: django websocket django-channels