主机m/c出错-无法在127.0.1:88建立到服务器的连接

时间:2023-02-10 18:56:14

Hi I'm learning django form kenneth love's GSWD video tutorials.

大家好,我正在从kenneth love的GSWD视频教程中学习django。

I'm using windows 7(32bit) and have vagrant and virtual box installed in it. The OS in virtual machine is Ubuntu 12.04 LTS

我正在使用windows 7(32位),并在其中安装了可移动的和虚拟的盒子。虚拟机中的操作系统是Ubuntu 12.04 LTS。

As asked in the tutorial I did the following

按照教程中的要求,我做了以下工作

**vagrant@precise32:/vagrant/projects$ source ~/blog.venv/bin/activate

* * vagrant@precise32:美元/流浪的项目源~ / blog.venv / bin /激活

Installed Django

安装Django

then created project with django-admin.py startproject microblog

然后与django-admin创建项目。py startproject微博

(blog.venv)vagrant@precise32:/vagrant/projects$ cd microblog

(blog.venv)vagrant@precise32:$ cd微博/流浪的项目

(blog.venv)vagrant@precise32:/vagrant/projects/microblog$ python manage.py runserver 0.0. 0.0:8000

(blog.venv)vagrant@precise32:美元/漂泊者/项目/微博python管理。py runserver 0.0。0.0:8000

Validating models... 0 errors found Django version 1.4.4, using settings 'microblog.settings' Development server is running at (http removed)//0.0.0.0:8000/ Quit the server with CONTROL-C.**

验证模型……0错误发现Django版本1.4.4,使用的是settings的微博。设置的开发服务器正在(http已删除)/ 0.0.0.0.0.0.0.0:8000/使用CONTROL-C.*退出服务器

After this when I go back to windows 7 browser and run 127.0.0.1:8888 as said in tutorial I get "can't establish a connection to the server at 127.0.0.1:8888" error.

在这之后,我回到windows 7浏览器并运行127.0.0.1:8888,正如我在教程中所说的,“无法建立与服务器的连接,在127.0.0.1:8888”错误。

What should I do to get the default "It Worked"-django page ???

我应该怎么做才能得到默认的“它工作了”-django页面?

1 个解决方案

#1


1  

Did you change the Vagrantfile to do port forwardings?

您是否更改了流浪文件来做港口代理?

For example, in your case, host port 8888 <=> guest port 8000

例如,在您的示例中,主机端口8888 <=>客户端端口8000

Vagrant.configure("2") do |config|
  config.vm.network :forwarded_port, guest: 8000, host: 8080
end

Refer to the docs: http://docs.vagrantup.com/v2/networking/forwarded_ports.html

参考文档:http://docs.vagrantup.com/v2/networking/forwarded_ports.html

#1


1  

Did you change the Vagrantfile to do port forwardings?

您是否更改了流浪文件来做港口代理?

For example, in your case, host port 8888 <=> guest port 8000

例如,在您的示例中,主机端口8888 <=>客户端端口8000

Vagrant.configure("2") do |config|
  config.vm.network :forwarded_port, guest: 8000, host: 8080
end

Refer to the docs: http://docs.vagrantup.com/v2/networking/forwarded_ports.html

参考文档:http://docs.vagrantup.com/v2/networking/forwarded_ports.html