0
我正在通过一个python金字塔教程,我一直在尽可能多的笔记,因为我可以在我写的文件内。腐败的开发.ini代码
发生了一些奇怪的事情,我想知道为什么。
我编写了像教程中所做的那样的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铬回报:
This site can’t be reached
0.0.0.0 refused to connect.
Search Google for 6543
ERR_CONNECTION_REFUSED
我删除评论:
[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
- 我在我的本地计算机上运行该代码
哇!这是一个很棒的提示,完全让这个尴尬的问题值得。 –