Gunicorn will not bind to my application

瘦欲@ 提交于 2019-12-03 12:15:39

Well that's not how you refer to the WSGI file with gunicorn. See the docs:

The module name can be a full dotted path. The variable name refers to a WSGI callable that should be found in the specified module.

So if your wsgi.py file is in GenericRestaurantSystem/wsgi.py, your command should be

gunicorn -b 127.0.0.1:8000 GenericRestaurantSystem.wsgi:application

I guess it should be

gunicorn GenericRestaurantSystem.wsgi:application

for me this work like charm :)

cd ~/myproject
gunicorn —bind 0.0.0.0:8000 myproject.wsgi:application

I had the same problem and got it to work with this:

gunicorn -b 127.0.0.1:8000 wsgi:application

I put the wsgi.py file at the same level as manage.py.

Create file in root you_django_name_project "main.py":

from you_django_name_project.wsgi import application
app = application

And run:

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