Configuring Gunicorn: No application module specified

♀尐吖头ヾ 提交于 2019-12-19 03:19:35

问题


I'm trying to deploy a django project with NGINX and gunicorn. I keep getting 502 Bad Gateway. I've been working nonstop on this for the past few days and I can't seem to get this deployed. I've gone through 3 tutorials on Digital Ocean, but they aren't correct, obviously.

I keep getting 502 bad gateway, or if I try to use manage.py runserver, I get 400 bad request.

I think my problem is with gunicorn. When I enter gunicorn -config, it says

usage: gunicorn [OPTIONS] [APP_MODULE] gunicorn: error: No application module specified.

Every bit of documentation I can find says to simply type gunicorn wsgi:application, but when I do, it says "workers failed to boot." How do I set an application module?


回答1:


Assuming you have nginx proxying to port 8001, you want to do this:

gunicorn -b 127.0.0.1:8001 your_project_name.wsgi:application

You need to run that from your project folder (where the manage.py file is)



来源:https://stackoverflow.com/questions/26748015/configuring-gunicorn-no-application-module-specified

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!