Making django server accessible in LAN

Issue

I have installed Django server and it can be accessed as below

http://localhost:8000/get-sms/
http://127.0.0.1:8000/get-sms/

suppose My IP is x.x.x.x .

From another PC under the same network when I do

my-ip:8000/get-sms/

but it is not working.

I can easily ping my IP with that computer.

Moreover, on my port 81, I have apache, which is easily accessible like below

http:///my-ip:81

What can be the issue? Do I need something extra in Django

Solution

Running the Django Development Server
This is what you’re looking for. To help you further, here is what you should do:

python manage.py runserver 0.0.0.0:8000

By the way, this may be a duplicate of this question.

Here is what the documentation says:

Note that the default IP address, 127.0.0.1, is not accessible from
other machines on your network. To make your development server
viewable to other machines on the network, use its own IP address
(e.g. 192.168.2.1) or 0.0.0.0.

Answered By – Depado

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published