I am facing problem while trying to start the server using the command
python manage.py runserver 0.0.0.0:8000
It is showing
C:\abc>python manage.py runserver 0.0.0.0:8000
Validating models...
0 errors found
Django version 1.4.9, using settings 'abc.settings'
Development server is running at http://0.0.0.0:8000/
Quit the server with CTRL-BREAK.
But cant access in browser via http://127.0.0.1:8000
It is showing :
Unable to connect
Firefox can't establish a connection to the server at 127.0.0.1:8000.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer's network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
But when I am trying the same by
python manage.py runserver
it is working fine. i can access the application http://127.0.0.1:8000
What can be the issue.
This executes the command and perform base checks if needed. This performs normal checks and migration checks if needed and then calls a function called handle . This function makes all the checks regarding IP address like checking port, IP address format ipv4 or ipv6.
Find the DEFAULT_PORT field. it is equal to 8000 by default. Change it to whatever you like DEFAULT_PORT = "8080" Restart your server: python manage.py runserver and see that it uses your set port number.
It looks like Port 8000 is in use by your external IP. Please have a look if a process is running and kill it.
You can check the open ports with netstat -a
. In Debian you get the PID with netstat -tulpn | grep 8000
. The last line should display something like 1234/python
. Now kill it with kill 1234
.
Alternative you could restart your system ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With