我正在尝试使用neo4django获得一个django应用程序,以便与驻留在graphenedb上的neo4j数据库对话。
我的本地安装工作得很好,但是连接到本地neo4j实例不需要身份验证。要连接到graphenedb,我需要传递我的凭据,但我想不出怎么做。
我可以在neo4django github (https://github.com/scholrly/neo4django/issues/224)上看到一个问题,这表明这应该是可能的,但我看不出是如何做到的。
我试着加入
'OPTIONS': {
'USERNAME': 'my username',
'PASSWORD': 'my password'
}到我的NEO4J_DATABASES字典中的默认条目,但我得到
File "......./neo4django/neo4django/neo4jclient.py", line 30, in __init__
super(EnhancedGraphDatabase, self).__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'PASSWORD'外面有人能搞定吗?
编辑
下面是我的NEO4J_DATABASES的其余部分(这些设置都是从我创建的NEO4J_URL环境变量中解析的):
NEO4J_DATABASES = {
'default' : {
'HOST': neo4j_uri.hostname,
'PORT': neo4j_uri.port,
'ENDPOINT': neo4j_uri.path,
'OPTIONS': {
'USERNAME': neo4j_uri.username,
'PASSWORD': neo4j_uri.password
}
}
}发布于 2014-02-16 20:18:22
你能试着用
'OPTIONS': {
'username': neo4j_uri.username,
'password': neo4j_uri.password
}(用小写键)代替?我相信这就是在提及的Github问题上起作用的原因。
https://stackoverflow.com/questions/21812824
复制相似问题