manage.py 运行服务器 [英] manage.py runserver

查看:31
本文介绍了manage.py 运行服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在跑步python manage.py runserver从机器 A当我尝试登记机器 B 时我输入的网址是 http://A:8000/我收到类似的错误系统返回:(111) Connection denied

I am running python manage.py runserver from a machine A when I am trying to check in machine B The url I typed is http://A:8000/ I am getting an error like The system returned: (111) Connection refused

推荐答案

您可以通过

./manage.py 运行服务器 0.0.0.0:8000

./manage.py runserver 0.0.0.0:8000

然后您将能够从网络中的任何机器访问您的服务器.只需在浏览器中在其他机器上输入 http://192.168.0.1:8000 其中 192.168.0.1 是您服务器的 IP ......它准备好了.......

And than you will be able to reach you server from any machine in your network. Just type on other machine in browser http://192.168.0.1:8000 where 192.168.0.1 is IP of you server... and it ready to go....

或者在你的情况下:

  1. 在机器 A 中的命令行 ./manage.py runserver 0.0.0.0:8000
  2. 比在机器B中尝试浏览器类型http://A:8000
  3. 喝一口啤酒.
  1. On machine A in command line ./manage.py runserver 0.0.0.0:8000
  2. Than try in machine B in browser type http://A:8000
  3. Make a sip of beer.

来自 django 文档

这篇关于manage.py 运行服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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