简体   繁体   English

金字塔博客教程无法在http:// localhost:6543看到网站

[英]Pyramid blogr tutorial can't see site at http://localhost:6543

I have a vagrant machine running as my dev environment. 我有一台无业游民的机器作为我的开发环境运行。

I am following the steps in this simple blog tutorial using pyramid(python) framework: http://docs.pylonsproject.org/projects/pyramid-blogr/en/latest/project_structure.html 我正在使用金字塔(python)框架执行此简单博客教程中的步骤: http : //docs.pylonsproject.org/projects/pyramid-blogr/zh-CN/latest/project_structure.html

Everything goes fine until I start the server. 一切正常,直到我启动服务器。 I get the message that the server is running 我收到服务器正在运行的消息

Starting subprocess with file monitor
Starting server in PID 2605.
Serving on http://localhost:6543

but going to the stated URL gives me a ERR_CONNECTION_REFUSED error. 但是转到指定的网址会给我一个ERR_CONNECTION_REFUSED错误。

I think this has something to do with it running on a VM. 我认为这与在VM上运行有关。 So when I go to my local browser, it's looking for something on my Mac not my VM. 因此,当我转到本地浏览器时,它正在Mac而不是VM上查找内容。

I tried changing the references to 127.0.0.1 in the development.ini to 0.0.0.0, but that did not fix. 我尝试将development.ini中对127.0.0.1的引用更改为0.0.0.0,但这并没有解决。

Can anyone explain to me what's happening and how to resolve? 谁能告诉我发生了什么事以及如何解决?

Figured it out. 弄清楚了。 It required two changes. 它需要进行两项更改。

In the actual Vagrantfile I had to add the port mapping like below, and destroy, relaunch the vagrant machine. 在实际的Vagrantfile中,我必须添加如下所示的端口映射,然后销毁并重新启动vagrant计算机。

  config.vm.network "forwarded_port", guest: 6543, host: 6543

And then, in my development.ini, I had to change the ip to use 0.0.0.0: 然后,在我的development.ini中,我不得不将ip更改为使用0.0.0.0:

[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM