[Fixed]-Gunicorn will not bind to my application

36πŸ‘

βœ…

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

6πŸ‘

I guess it should be

gunicorn GenericRestaurantSystem.wsgi:application
πŸ‘€sb9

1πŸ‘

for me this work like charm πŸ™‚

cd ~/myproject
gunicorn β€”bind 0.0.0.0:8000 myproject.wsgi:application
πŸ‘€Hamid Zandi

1πŸ‘

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.

πŸ‘€Evan Zamir

0πŸ‘

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
πŸ‘€user102512

Leave a comment