Type "help", "copyright", "credits" or "license" for more information.
>>> import eve
>>> from eve import Eve
>>> eve
<module 'eve' from '/usr/local/lib/python2.7/dist-packages/eve/__init__.pyc'>
>>> app = Eve()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/eve/flaskapp.py", line 139, in __init__
self.validate_domain_struct()
File "/usr/local/lib/python2.7/dist-packages/eve/flaskapp.py", line 252, in validate_domain_struct
raise ConfigException('DOMAIN dictionary missing or wrong.')
eve.exceptions.ConfigException: DOMAIN dictionary missing or wrong.
>>>
这种情况发生了,我似乎无法找出错误是什么,因为这是在Digital Ocean上新创建的Ubuntu映像。除了用pip安装Python eve之外,没有任何事情可以触及。
答案 0 :(得分:1)
您需要在与应用程序相同的目录中包含settings.py
文件,或者您需要在应用初始化时将路径传递给settings.py
并使用密钥settings
。查看quickstart指南,了解最小应用程序。
settings.py
文件应该包含您的资源定义,即错误提及的DOMAIN
字典。