配置 Gunicorn:未指定应用程序模块
·
回答问题
我正在尝试使用 NGINX 和 gunicorn 部署一个 django 项目。我不断收到 502 Bad Gateway。在过去的几天里,我一直在不停地工作,但我似乎无法部署它。我已经阅读了 3 个关于 Digital Ocean 的教程,但显然它们都不正确。
我不断收到 502 bad gateway,或者如果我尝试使用 manage.py runserver,我收到 400 bad request。
我认为我的问题是与 gunicorn。当我输入 gunicorn -config 时,它说
usage: gunicorn [OPTIONS] [APP_MODULE] gunicorn: error: No application module specified.
我能找到的每一点文档都说只需键入 gunicorn wsgi:application,但是当我这样做时,它会显示“workers failed to boot”。如何设置应用模块?
Answers
假设你有 nginx 代理到端口 8001,你想这样做:
gunicorn -b 127.0.0.1:8001 your_project_name.wsgi:application
您需要从项目文件夹(manage.py 文件所在的位置)运行它
更多推荐

所有评论(0)