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
π€Daniel Roseman
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
- Django: I get a [relation "auth_group" does not exist] error after syncdb
- Django form with fields from two different models
- How to get all objects by instance in django
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
- Make Django test case database visible to Celery
- Add a prefix to URL patterns
- Django Testing β Hard code URLs or Not
- Django: WSGIRequest' object has no attribute 'user' on some pages?
Source:stackexchange.com