Gunicorn will not be attached to my application

I created a django web application using the default localhost, however I am trying to configure it on the server to configure the postgre database and continue working without having to add the database again.

I host the site, although the digital ocean ubuntu is 14 drops. When I created the blob, I chose that it was already configured for django. It uses nginx and gunicorn to host the site.

When I first created the server instance, the main django application was configured to work with this IP. And that happened.

I tried to clone my project into the same directory as this project, assuming it would live in the python path ('/ home / project') and configured nginx to serve 127.0.0.1:8000 for the part of the documentation I found,

I think the problem is when I try to tie up the gunner. I get the following error with this input.

gunicorn -b 127.0.0.1:8000 GenericRestaurantSystem / wsgi.py: application

ImportError: Failed to find application, did you mean 'program/wsgi:application'? 

I am not 100% sure, but it seems that at this moment the firing officer is not serving anything (or even not included).

Any suggestions for successfully binding this app?

+7
python django nginx gunicorn
source share
4 answers

Well, that’s not how you refer to the WSGI file with a gun. See the docs :

The module name can be a complete dotted path. The variable name refers to the WSGI being called, which must be found in the specified module.

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

 gunicorn -b 127.0.0.1:8000 GenericRestaurantSystem.wsgi:application 
+19
source share

I think it should be

 gunicorn GenericRestaurantSystem.wsgi:application 
+5
source share

I had the same problem and had 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 .

+1
source share

for me this work is like a charm :)

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

All Articles