【发布时间】:2014-02-16 14:57:25
【问题描述】:
我正在尝试使用 neo4django 让 django 应用程序与托管在 graphenedb 上的 neo4j 数据库通信。
我的本地安装运行良好,但连接到我的本地 neo4j 实例不需要身份验证。要连接到 graphenedb,我需要传递我的凭据,但我不知道该怎么做。
我可以在 neo4django github repo (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
}
}
}
【问题讨论】:
-
你能分享你的
NEO4J_DATABASESdict的其余部分吗?
标签: django neo4j neo4django