Report this

What is the reason for this report?

Server Error 500 Django Digital Ocean

Posted on May 5, 2017

i’ve deployed my django project in digital ocean, I’m getting Server Error(500), however the url is showing me “myipaddress/accounts/login/?next=/” . I could n’t figure out what is causing error. I’ve kept DEBUG=False even in settings.py



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Sorry to see that your question hasn’t received an answer yet. Unfortunately, after this much time, it is unlikely an answer for this specific question will be provided without more information. For people still landing here via search, here’s one tip that might point you in the right direction when degugging.

Beginning with Django 1.5 a new “allowed hosts” setting was introduced. When DEBUG is set to False, it is enforced. In your settings.py file, find the that looks like:

ALLOWED_HOSTS = []

and change it to include the Droplet’s IP address and/or the domain name pointing to your site. For example:

ALLOWED_HOSTS = ["example.com", "111.111.111.111"]

Also, check out this tutorial for full step-by-step instructions for getting a Django site up and running:

I have a similar problem. when loggedin i and try to access a page, i get the server error(500) on the browser. but when looged out i get no such massage and can access the page. however images uploaded through the admin site would’t display and won’t even open if i try viewing them the the said admin site. please someone help.

Try to activate your virtual environment, run “python manage.py makemigrations” and python manage.py migrate"

even if makemigrations return “no changes made” still run “migrate”.

Then restart your gunicorn and nginx: run “sudo systemctl restart gunicorn” and “sudo systemctl restart nginx”

Hope this helps

The developer cloud

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

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.