【发布时间】:2017-08-30 03:56:33
【问题描述】:
我正在完成一个 python 金字塔教程,并且我一直在我正在编写的文件中做尽可能多的笔记。
发生了一些奇怪的事情,我想知道为什么。
我像在教程中那样编写了 development.ini 文件,然后添加了注释。
# we are using this file for configureation in development
# config our wsgi
[app:main]
# which entry point to use as the app
use = egg:mysite
# reloads when templates are changed, not to be used in production
pyramid.reload_templates = true
#which server to use
[server:main]
#get the main entry point from the waitress package
use = egg:waitress#main
host = 0.0.0.0
port = 6534
# this is a great way to remove code for the rest of our package
# more importantly this file is easy to tweak for launching our package in a different manner
运行 pserve development.ini chrome 返回:
This site can’t be reached
0.0.0.0 refused to connect.
Search Google for 6543
ERR_CONNECTION_REFUSED
我删除了 cmets:
[app:main]
use = egg:mysite
pyramid.reload_templates = true
[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6534
我收到与以前相同的错误。
This site can’t be reached
0.0.0.0 refused to connect.
Search Google for 6543
ERR_CONNECTION_REFUSED
然后我将代码从教程存储库复制并粘贴到 development.ini:
[app:main]
use = egg:mysite
pyramid.reload_templates = true
[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
我已成功访问本地主机。
我最想知道为什么会发生这种情况,如何避免这个问题,以及如果可能的话如何注释 development.ini 文件。
注意:
- 我正在使用 PyCharm 作为我的 ide
- 我正在本地计算机上运行此代码
【问题讨论】:
标签: python-3.x pycharm pyramid