我试过按照指南将mongokit整合到这里的挂架:http://namlook.github.com/mongokit/pylons.html
当我用贴纸服务时,它会抛出错误:
File "/home/ciferkey/Projects/runnr-site/runnrsite/config/environment.py", line 29, in load_environment
config['pylons.app_globals'] = app_globals.Globals(config)
TypeError: __init__() takes exactly 1 argument (2 given)
如果我将伪参数抛入Globals的 init :
def __init__(self, foo):
然后它不再抛出错误而是抛出:
File "/usr/lib/pymodules/python2.6/pylons/configuration.py", line 141, in __getitem__
return dict.__getitem__(self, name)
KeyError: 'db_host'
现在这是引用lib / app_globals.py中指南告诉你输入的行:
self.connection = Connection(
host = config['db_host'],
port = int(config['db_port']),
)
我知道我要用实际信息替换db_host和db_port,但无论我尝试什么,都会抛出同样的错误。关于为什么会发生这种情况的任何想法?
答案 0 :(得分:0)