首页 > 解决方案 > 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.

标签: djangogunicorn

解决方案


推荐阅读