Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
404 views
in Technique[技术] by (71.8m points)

python - Making django server accessible in LAN

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...