Can not see my Django website on browser on running it from Digital Ocean VPS

November 24, 2015 1.1k views
Deployment DigitalOcean Django Nginx Firewall

I have successfully set up my Digital Ocean VPS and deployed my Django website on the same.But when I run the project in my local system using python's runserver python manage.py runserver command, it works pretty well and I am able to see the site on browser on localhost. But when I do the same thing from DigitalOcean's Ubuntu 14.04 x64 VPS, it runs fine without any error but the site do not loads on the browser of my system. Same is the case if I run the project using nginx and gunicorn. Can any one please help me solving this issue?

2 Answers

@billiondollarco

Is this the same site where you followed the guide located here? If anything differs, please post additional details about your configuration and deployment.

by Stephen Tippets
Here you'll learn how to deploy a local Django app to a VPS.
  • Hi @jtittle ,

    Yes I followed the same. But in order to go step by step firstly I am just trying to load my website on localhost in my browser by running the project using runserver command on production server. Once it goes well, I will move forward to try to run the project using nginx and gunicorn (Though setup for both is ready as per the guide you mentioned in your comment).

Most likely your static files are not being loaded by the server.
Make sure the following are taken care of:

  1. Add the path to your static files in settings.pySTATIC_ROOT = os.path.join(BASE_DIR, 'static')
  2. Run python manage.py collectstatic
  3. Also make sure your ip address or domain is added to your ALLOWED_HOSTS in settings.py
Have another answer? Share your knowledge.