Question

Can't reach django app when running python manage.py runserver 0.0.0.0:8000

Posted May 23, 2021 80 views
DjangoDeployment

I have followed the https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-20-04 tutorial on setting up a django server but i cant reach my app outside the server, i have already open up port 8000 using ufw, what might be the error?

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.

×
Submit an Answer
2 answers

After many many hours of research i came across this post in stackoverflow https://stackoverflow.com/questions/56117774/digital-ocean-open-port-8080-for-spring-boot-application basically the important part was this
I’m not 100% sure why, but the Firewall rules from the Digital Ocean Firewall Control panel were interfering with my droplet configuration.

I’ve deleted the Firewall rules from the control panel and now netstat reports that my 8080 port is open and I’m able to talk to the server from the outside world, finally.

I deleted the Droplet firewall rules and let only the rules created with ufw and the issue was fixed. hope it helps

Hi @marosersa,

I see you found a solution but yes, by Default ports are closed to public reach unless specifically specified. As such you had to open the port on either UFW or Iptables depending if ufw is enabled.

Additionally, there are times where if you configured rules on the Digital Ocean Firewall Control panel they can further interfere with the reach on certain port.

Anyway, thank you for posting your findings and solutions for other users that find this Quesiton.