Can't access Django server from browser

Hi all,

I am working on a centOS7 server, I created a project and used python runserver command.

From a browser on my local machine, I cannot access the localhost:8000 address.

I tried precising the address like python runserver

Added also ‘*’ to the ALLOWED HOSTS in

Nothing worked. I still can’t access from the browser on my local machine.


That’s because that other host isn’t “localhost”. Specify the ip address of the server in your browser.

(Side note, if this is your targeted deployment environment, be aware that you should not be using runserver as your production server. See How to deploy Django | Django documentation | Django)

serverIP:8000 which is the server’s IP address is NOT accessible from my browser.

Please be more specific here. What exactly are you seeing?

Can you ssh from your system to that server?

Do you have a firewall running on that server? Is port 8000 open?

Side note: You’re not “securing” anything by obscuring the last segment of your ip address. It’s possible to scan that entire range in well less than 5 minutes. (And your local workstation address - 192.168.xx.xx - is a non-routable address that can’t be accessed through the internet anyway.)

You are right. The port 8000 was not open in the server’s firewall.
Now that I opened it, the server is accessible within my system.

Thank you so much

i have the same problem but i can not understand the solution can you help me

If you are having a problem that you would like assistance with, please open up a new topic to discuss it.

Please include all the relevant details about your deployment environment, include the errors you are receiving or the symptoms being presented.