Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to deploy my Django app for the first time on a Digital Ocean VPS. I've used their Django droplet which setup things like this except I'm not using a virtual environment.

After adding my code and changing a few things, if I run gunicorn directly from the command line, the site loads.

However, if I run gunicorn as a service sudo service gunicorn start, I just get an 500 "Internal Service Error". There is no error in the nginx log file. The gunicorn log file does not exist.

Here is the command I run that works (run from the /home/django directory):

gunicorn --pythonpath=myproject --bind= --config /etc/gunicorn.d/ myproject.wsgi:application

Here is the /etc/init/gunicorn.conf file:

description "Gunicorn daemon for Django project"

start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [!12345]

# If the process quits unexpectedly trigger a respawn

setuid django
setgid django
chdir /home/django

exec gunicorn \
    --name=myproject \
    --pythonpath=myproject \
    --bind= \
    --config /etc/gunicorn.d/ \

I'm new to gunicorn and nginx so this is really stumping me.

share|improve this question

Internal Server Error (HTTP 500) usually indicates that there is a problem with your code, not the Web Server application.

Have you set up logging?
You should log all 500 errors to a file in your django project, so that you can see why the error is occurring.

You can also try switching on Debug mode, which should tell you why the application is failing.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.