我使用的是vagrant和Virtualbox,所以我不能在默认端口和地址上使用runserver
,否则它将不起作用。
Django说:
(...) to listen on all public IPs (useful if you want to show off your work on
other computers), use:
python manage.py runserver 0.0.0.0:8000
然后我试图通过http://127.0.0.1:8888/
访问服务器,但它显示Unable to connect
。你猜怎么正确运行服务器吗?
我遵循了gettingstartedwithdjango
视频,这个http://127.0.0.1:8888/
为作者工作。
必须使用根权限运行。如果您使用
sudo
运行,您将成功。更新1
前面的信息与主题无关。 在流浪汉中,你必须把你的港口转到当地港口。请看一下this。
更新2
This page解释了如何在一个流浪箱中安装和配置django。
相关问题 更多 >
编程相关推荐