当我在ssh上运行django runserver时,Vagrant不转发 [英] Vagrant is not forwarding when I run django runserver on ssh

查看:258
本文介绍了当我在ssh上运行django runserver时,Vagrant不转发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Vagrant Ubuntu(lucid32)框,其中包含Python& Django的。我的想法是启动虚拟机,使用 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屋!

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