我想在我的社交网络 Django 项目中有两个数据库,一个是 realtional,一个是 graphbased。我选择 Mysql 和 Neo4j settings.py
。我的项目中的文件是:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mylife',
'USER': 'root',
'PASSWORD': 'mypassword',
'HOST': '',
'PORT': '',
}
}
NEO4J_DATABSES = {
'default':{
'HOST':'localhost' ,
'PORT':7474,
'ENDPOINT':'db/data'
}
}
我NEO4J_DATABSES
根据neo4django文档附加部分,但是当我运行时pyhon manage.py syncdb
出现以下错误:
AttributeError: 'Settings' object has no attribute 'NEO4J_DATABASES'
当python manage.py shell
我写这些代码来测试某些东西时,我得到了同样的错误:
>>> from neo4django.db import models
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/neo4django-0.1.8-py2.7.egg/neo4django /db/__init__.py", line 95, in <module>
if not _settings.NEO4J_DATABASES:
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__
return getattr(self._wrapped, name)
AttributeError: 'Settings' object has no attribute 'NEO4J_DATABASES'