在localhost正在工作时,我看不到我的python django服务器通过IP [英] I can not see my python django server via IP while the localhost is working
问题描述
操作系统是Windows Server 2008.没有安装任何防病毒或防火墙,并且Windows防火墙被禁用。
我从服务器发送的消息很明显网络中其他一些设备的程序已成功交付。换句话说,连接是单向的(不是双工的)
假设你正在使用Django开发服务器:要使您的开发服务器可以查看
网络上的其他计算机,请使用自己的IP地址(例如192.168.2.1),或者是
$ b 0.0.0.0或::
(启用IPv6)。
所以,你的命令看起来像
runserver 0.0.0.0:8000
I have written a server program using python and django and I have tested it in several computers. Now I have installed it on a HP server. While I can see that it is working when I type localhost in browser address, when I type the server's IP, I see "This webpage is not available" (ERR_CONNECTION_REFUSED).
The OS is windows server 2008. There isn't any antivirus or firewall installed and the windows firewall is disabled.
It's noticeable that the messages that I send from my server program to some other devices in the network are successfully delivering. In the other word the connection is one-way (not duplex)
Assuming you're using the Django development server:
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 or :: (with IPv6 enabled).
So, your command will look something like
runserver 0.0.0.0:8000
这篇关于在localhost正在工作时,我看不到我的python django服务器通过IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!