2013-08-03 48 views
0

我想在我的社交網絡中有兩個數據庫Django項目一個realtional和一個基於graphbased.i選擇Mysql和Neo4j.my settings.py file in我的項目是:錯誤:'設置'對象沒有屬性'NEO4J_DATABASES'爲django項目添加neo4j db時

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' 
    } 
} 

我根據neo4django documents追加NEO4J_DATABSES部分,但是當我運行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' 

回答

1

你已經是拼寫錯誤在你settings.py

NEO4J_DATABSES 

應該是:

NEO4J_DATABASES 
+0

我不知道該如何感謝很周到,謝謝很多人:你是對的 – djangoman

相關問題