I have made a django web app using the default localhost, however I am trying to set it up on a server so that I can configure a postgre database and continue on without having to redo the database later on.
I am hosting the site though a digital ocean ubuntu 14 droplet. When I created the droplet I selected that it already come preconfigured for django. It uses nginx and gunicorn to host the site.
When I first created the instance of the server, a basic django app was configured to work on the given IP. And it did.
I tried cloning my project into the same directory as that project assuming it would live on the python path ('/home/project') and configured the nginx to serve up 127.0.0.1:8000 per some of the documentation I found.
I believe the issue lies in when I try to bind gunicorn. 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 as though gunicorn is not serving up anything (or not even on) at this point.
Any suggestions as to binding this application successfully?
for me this work like charm :)
I guess it should be
I had the same problem and got it to work with this:
I put the
wsgi.py
file at the same level asmanage.py
.Well that's not how you refer to the WSGI file with gunicorn. See the docs:
So if your wsgi.py file is in GenericRestaurantSystem/wsgi.py, your command should be
Create file in root you_django_name_project "main.py":
And run: