Not sure why my django project isnt running. Get a "502 Bad Gateway nginx/1.10.3 (Ubuntu)" error

August 30, 2017 444 views
Django Ubuntu 16.04

This is my first time using digitalOcean so I'm not quite sure how it all works.

I setup a droplet with the 1-click install for django on 16.04, I went to the ip address in the browser and the default start page was running.

Then I went into my home directory and deleted my django/ folder holding the default django project created when I setup my droplet.

I cloned my git repository into the /home directory and installed all the necessary requirements. I can run the server with no issues coming up in bash but still get that 502 Bad gateway error.

I tried running service gunicorn restart but no luck. I have a feeling its a gunicorn settings. I'm not sure how to see the errors also. I've only used PythonAnywhere before so not too sure how everything works here. Thanks for your help

1 comment
  • please open this file /etc/systemd/system/gunicorn.service
    and change default path to your project path and python path

2 Answers

$ 10 dollars can do what? Eat a meal or a day pocket money.

I looked here but it is for Ubuntu 14.04 and does not have the same configuration. gunicorn.conf doesnt exist in etc/init/

https://www.digitalocean.com/community/tutorials/how-to-use-the-django-one-click-install-image-for-ubuntu-14-04

please can anyone help

Django is a high-level Python framework for developing web applications rapidly. DigitalOcean's Django One-Click app quickly deploys a preconfigured development environment to your VPS employing Django, Nginx, Gunicorn, and Postgres.
Have another answer? Share your knowledge.