skip to Main Content

My attempt to create/integrate Postgresql database and run Django development server continues to fail and I’ve followed every step in this tutorial (search page for ‘Setting Up PostgreSQL with Django’): (website 1) https://www.hostinger.com/tutorials/django-tutorial

When I run the development server and type in the browser http://127.0.0.1:8000 to connect, I get a page cannot be reached. ERR_CONNECTION_REFUSED

Thinking it is a firewall issue I then followed the instructions on this page to open both (8000 port & 5432 port to any ip address (I copied example 1 on the page) –> 5432 is the default PostgreSQL port so I included that as well with 8000 just incase, and it still does not work: (website 2) https://linuxconfig.org/how-to-open-allow-incoming-firewall-port-on-ubuntu-22-04-jammy-jellyfish

I double checked and know that I entered in my settings.py file the correct Database engine, name, user, password, host, and port because I followed the steps in (website 1).

And I tried opening both the 5432 and 8000 port to any ip address incase the page was not opening because of a firewall issue from the example 1 in (website 2).

I don’t know what else to do.

Please help, I am so frustrated!

2

Answers


  1. Chosen as BEST ANSWER

    Although my VPS had ports 8000 and 5432 manually opened, my computer itself has all ports closed. Right now i'm "googling" how to open my ports to my Hostinger/VPS only.

    I figured my own computers ports were closed using this website: https://www.yougetsignal.com/tools/open-ports/


  2. @Dharman, interesting, I thought this was the accepted procedure if you answer you own question. I have seen that comment often. Could you tell me what is misleading about it?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search