Why can I connect to http://127.0.0.1:8000/ but not to http://192.168.1.6/ Why can I connect to http://127.0.0.1:8000/ but not to http://192.168.1.6/ django django

Why can I connect to http://127.0.0.1:8000/ but not to http://192.168.1.6/


When you start Django development server you need to give the address explicitly:

python manage.py runserver 192.168.1.6:8000

Or if you want the server to run on all interfaces you can use:

python manage.py runserver 0.0.0.0:8000

In other case Django development server defaults to running on the local interface only.


The problem for me was I accidentally quit the server whenever trying to copy the server address. So instead of using ctrl+C just write down the address into your browser.


I solved the issue.There are a few things you might be missing.Listing them below-

1.Once it starts the server, do not press Ctrl+C anyhow .u might be pressing it to copy to url and that accidently closes the server due to which it might be happening.

2.instead of http://127.0.0.1:8000/ ...change the port number to http://127.0.0.1:8080/ ...That would work.

3.Try changing the firewall setting and allow the app.

4.Try opening it with different browsers and incognito too.

The above steps helped solve my issue.Hope they help u too...:)