我正在使用金字塔框架并使用pcreate命令设置脚手架。当我打电话给../pserve development.ini时,我遇到了一个没有区域的错误。
Victors-MacBook-Pro:firefly yuanshizhan$ ../pserve development.ini
bugsnag.configuration.release_stage = development
** [Bugsnag] Notifying http://notify.bugsnag.com of exception
Traceback (most recent call last):
File "../pserve", line 9, in <module>
load_entry_point('pyramid==1.5.1', 'console_scripts', 'pserve')()
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/scripts/pserve.py", line 51, in main
return command.run()
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/scripts/pserve.py", line 316, in run
global_conf=vars)
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/scripts/pserve.py", line 340, in loadapp
return loadapp(app_spec, name=name, relative_to=relative_to, **kw)
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/loadwsgi.py", line 247, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/loadwsgi.py", line 272, in loadobj
return context.create()
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/loadwsgi.py", line 710, in create
return self.object_type.invoke(self)
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/loadwsgi.py", line 146, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/PasteDeploy-1.5.2-py2.7.egg/paste/deploy/util.py", line 55, in fix_call
val = callable(*args, **kw)
File "/Users/yuanshizhan/send_mail/bin/firefly/earn/__init__.py", line 151, in main
config.scan()
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/pyramid-1.5.1-py2.7.egg/pyramid/config/__init__.py", line 930, in scan
ignore=ignore)
File "/Users/yuanshizhan/send_mail/lib/python2.7/site-packages/venusian-1.0-py2.7.egg/venusian/__init__.py", line 205, in scan
__import__(modname)
File "/Users/yuanshizhan/send_mail/bin/firefly/earn/depositgoal.py", line 41, in <module>
DB_URL = PARSER.get("app:main", "sqlalchemy.url")
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 607, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'app:main'
我很确定&#39; app:main&#39;在development.ini中。无论如何要解决这个问题?喜欢将方法导入development.ini文件?