Report this

What is the reason for this report?

Deploy Django 1.7 Application (using DigitalOcean quick start tutorial) - Error 500 =(

Posted on September 28, 2014

Hello, everyone!

I tried to follow this tutorial link, but it hasn’t worked for me. =(

I know that error 500 should be an application error, but, the application works fine on my computer.

This is nginx configs

upstream app_server {
    server 127.0.0.1:9000 fail_timeout=0;
}

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/html;
    index index.html index.htm;

    client_max_body_size 4G;
    server_name _;

    keepalive_timeout 5;

    # Your Django project's media files - amend as required
    location /media  {
        alias /home/django/agenciafacilonline/media;
    }

    # your Django project's static files - amend as required
    location /static {
        alias /home/django/agenciafacilonline/agenciafacilonline/static;
    }

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_pass http://104.131.104.172/;
    }
}

This is my gunicorn configs

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
respawn

setuid django
setgid django
chdir /home/django

exec gunicorn \
    --name=agenciafacilonline \
    --pythonpath=agenciafacilonline \
    --bind=0.0.0.0:9000 \
    --config /etc/gunicorn.d/gunicorn.py \
    django_project.wsgi:application

Do I need to do anything more?

Many thanks

@HigorSilvaRosa

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.