当我在ssh上运行django runserver时,Vagrant不转发 [英] Vagrant is not forwarding when I run django runserver on ssh
本文介绍了当我在ssh上运行django runserver时,Vagrant不转发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
vagrant ssh
登录,然后运行以下命令启动Django: manage.py runserver
默认为端口8000.问题是我无法从主机的浏览器 http://127.0.0.1:8000
访问Django服务器。我可以做什么?
解决方案
您需要将服务器绑定到外部IP:
manage.py runserver 0.0.0.0:8000
I created a Vagrant Ubuntu (lucid32) box with Python & Django. My idea is start the VM, log into it with vagrant ssh
, and then start Django by running:
manage.py runserver
which defaults to port 8000. The problem is that I can not access the Django server from the host's browser at http://127.0.0.1:8000
. What can I do?
解决方案
You need to bind the server to the external IP with:
manage.py runserver 0.0.0.0:8000
这篇关于当我在ssh上运行django runserver时,Vagrant不转发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文