小编Aun*_*idi的帖子

模块已安装,但运行 Gunicorn 时出现“ModuleNotFoundError:没有名为 <module_name> 的模块”

我正在尝试使用 nginx 部署这个网站。该站点配置正确,并且在我运行时已验证这一点python manage.py runserver。但是当我使用 Gunicorn 和 wsgi 运行相同的命令时,gunicorn --bind 0.0.0.0:8002 config.wsgi它会显示 error: ModuleNotFoundError: No module named 'crispy_forms'

Crispy_forms 已安装并已使用 进行验证pip freeze。虚拟环境也已启用。'crispy-forms' 也已经添加到 中的 INSTALLED_APPS 中settings.py

以下是我的错误代码:

root@devvm:/tmp/tmc_site# gunicorn --bind 0.0.0.0:8002 config.wsgi
[2022-02-03 23:03:07 +0000] [6333] [INFO] Starting gunicorn 20.1.0
[2022-02-03 23:03:07 +0000] [6333] [INFO] Listening at: http://0.0.0.0:8002 (6333)
[2022-02-03 23:03:07 +0000] [6333] [INFO] Using worker: sync
[2022-02-03 23:03:07 +0000] [6335] [INFO] Booting worker with pid: 6335
[2022-02-04 04:03:07 +0500] [6335] …
Run Code Online (Sandbox Code Playgroud)

python django wsgi gunicorn

1
推荐指数
1
解决办法
7363
查看次数

标签 统计

django ×1

gunicorn ×1

python ×1

wsgi ×1