django - Django:无法运行 gunicorn
问题描述
我尝试运行 gunicorn 但它失败了我在我的虚拟环境中安装了 gunicorn (pip install gunicorn)
cd intensetbm_app/intensetbm-etool
gunicorn intenseTBM_eTool.wsgi:application
我的项目架构:
envs
intensetbm_app
| intensetbm-etool
| | intenseTBM_eTool
| | | wsgi.py
| | | settings.py
| | | ...
| | manage.py
| | ...
intensetbm_static
wsgi.py
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'intenseTBM_eTool.settings')
application = get_wsgi_application()
跟踪(部分):
...
File "/home/test/intensetbm_app/intensetbm-etool/intenseTBM_eTool/wsgi.py", line 12, in <module>
from django.core.wsgi import get_wsgi_application
ModuleNotFoundError: No module named 'django'
[2020-03-18 15:00:20 +0000] [43251] [INFO] Worker exiting (pid: 43251)
[2020-03-18 15:00:20 +0000] [43248] [INFO] Shutting down: Master
[2020-03-18 15:00:20 +0000] [43248] [INFO] Reason: Worker failed to boot.
解决方案
推荐阅读
- python-3.x - Uncaught ReferenceError: False 未在 python django 模板中定义
- java - 使用默认设置时使用哪个 Spring Cloud Zuul 超时属性?
- python - 将两个变量分配给同一列表中的项目是访问这些项目并对其执行操作的最佳方式吗?
- kubernetes - 用户如何在不访问 Rancher GUI 的情况下获取其 kubeconfig
- vb.net - 在 type="date" 的 TextBox 中显示日期
- javascript - 如何在本机反应中将状态从兄弟姐妹发送或传递给兄弟姐妹?
- java - 如何修复 java.lang.IllegalStateException:预期 BEGIN_OBJECT 但在第 1 行第 1 列路径 $
- java - 使用 SXSSFWorkbook 创建 excel 并使用 XSSFWorkbook 修改时,字符串单元格数据在 excel 编辑器中不可见
- java - 在集成测试中在 Spring 控制器中模拟 Feign 客户端
- android - TextView 使用转义字符显示错误