在localhost正在工作时,我看不到我的python django服务器通过IP [英] I can not see my python django server via IP while the localhost is working

查看:112
本文介绍了在localhost正在工作时,我看不到我的python django服务器通过IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用python和django编写了一个服务器程序,我已经在几台电脑上测试过了。现在我已经安装在HP服务器上了。虽然我可以看到在浏览器地址中输入localhost时工作,当我输入服务器的IP时,我看到这个网页不可用(ERR_CONNECTION_REFUSED)。



操作系统是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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆