无法浏览 django 站点
Could not browse django site
我正在尝试关注 django tutorial but when when I get to the python manage.py runserver
step, I can't browse http://127.0.0.1:8000/ in chrome or IE. But when I wget in bash, I was able to get the html from http://127.0.0.1:8000。我正在使用 windows 10 周年纪念版,我正在使用 virtualenv。
既然你说你在 bash 中使用 wget,我假设你没有使用 windows,所以可能是另一台机器。
当您告诉 django 监听 127.0.0.1
时,它将只接受本地连接。
现在要向所有人开放 django,您必须 运行 这样做 :
python manage.py runserver 0.0.0.0:8000
此外,您还必须确保您的网关接受端口 8000 上的连接并将它们转发到您的计算机,其中 django 运行s。 (参见端口转发)。
我正在尝试关注 django tutorial but when when I get to the python manage.py runserver
step, I can't browse http://127.0.0.1:8000/ in chrome or IE. But when I wget in bash, I was able to get the html from http://127.0.0.1:8000。我正在使用 windows 10 周年纪念版,我正在使用 virtualenv。
既然你说你在 bash 中使用 wget,我假设你没有使用 windows,所以可能是另一台机器。
当您告诉 django 监听 127.0.0.1
时,它将只接受本地连接。
现在要向所有人开放 django,您必须 运行 这样做 :
python manage.py runserver 0.0.0.0:8000
此外,您还必须确保您的网关接受端口 8000 上的连接并将它们转发到您的计算机,其中 django 运行s。 (参见端口转发)。