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 or :: (with IPv6 enabled).
应该用中央系统或服务器来完成。
默认情况下,
manage.py runserver
不会授予ip绑定权限。所以如果要签入本地计算机,请遵循
现在转到网络计算机并像
192.168.1.24:8000
那样访问ip更新:
对于Django版本约1.10,您应该将主机添加到允许的主机here
只需将您自己的IP地址添加到允许的主机
允许的_主机=['192.168.1.50','127.0.0.1','localhost']
运行服务器
python manage.py runserver 192.168.1.50:8000
并将自己的服务器访问到网络中的其他计算机
使用IP地址运行应用程序,然后在其他计算机中访问它。
python manage.py运行服务器192.168.56.22:1234
两台机器应该在同一个网络中,只有这样才能工作。
相关问题 更多 >
编程相关推荐