0.0.0.0:8000 This site can’t be reached #4328
-
What happened?When I start PyCharm with the "runserver" configuration and call http://0.0.0.0:8000/ with Google Chrome, I get the message "This site can't be reached". What should've happened instead?The website should load. Additional details
|
Beta Was this translation helpful? Give feedback.
Replies: 7 comments
-
I think 0.0.0.0 just means to expose the port for other devices. FOr instance, if you try to connect with your phone to your local/private ip address like |
Beta Was this translation helpful? Give feedback.
-
Then shouldn't cookiecutter-django default to 127.0.0.1? |
Beta Was this translation helpful? Give feedback.
-
Wdym default to? |
Beta Was this translation helpful? Give feedback.
-
the mention address should be run in your local system like this in pycharm editor |
Beta Was this translation helpful? Give feedback.
-
It works fine on my machine (macOS) with Docker (which I thought was the problem). Is 0.0.0.0 a special IP address that is working differently on Windows? What options have you selected when generating the project? This is in the issue template but I don't see it in the original report... 😞
(Yes, the questions we're asking in the issue template are actually useful, please fill them...) |
Beta Was this translation helpful? Give feedback.
-
{ |
Beta Was this translation helpful? Give feedback.
-
In my opinion, it is not a bug at all. When you run your application on host 0.0.0.0:8000, the application is bound to all network interfaces on the machine it is running on. This allows the application to be accessible from any device connected to the same network as the machine running the application. However, when you try to access the application using the address 0.0.0.0:8000 in your browser, the browser may not be able to resolve the IP address correctly. This is because 0.0.0.0 is a special IP address representing all network interfaces on the local machine, but it is not a valid IP address for external connections. On the other hand, when you use the address 127.0.0.1:8000, you are accessing the application through the loopback interface, a virtual network interface that allows a client to connect to a server running on the same machine. This address is always available and accessible from the same machine the application runs on, regardless of the network configuration. To access your application from another device on the same network, you should use the IP address of the machine running the application instead of 0.0.0.0:8000. To make a long story short - it is not a bug, it is how networking works, and you should use 127.0.0.1:8000 when you run your application on localhost. |
Beta Was this translation helpful? Give feedback.
In my opinion, it is not a bug at all.
When you run your application on host 0.0.0.0:8000, the application is bound to all network interfaces on the machine it is running on. This allows the application to be accessible from any device connected to the same network as the machine running the application.
However, when you try to access the application using the address 0.0.0.0:8000 in your browser, the browser may not be able to resolve the IP address correctly. This is because 0.0.0.0 is a special IP address representing all network interfaces on the local machine, but it is not a valid IP address for external connections.
On the other hand, when you use the address 127.0.0.1:8000, you a…