我收到以下錯誤:Django數據庫設置:我們可以保留默認數據庫爲空字典嗎? [Django的1.8]
ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE VALUE.
我的settings.py樣子:
DATABASES = {
'default': {
},
'postgres': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'app',
'USER':'user',
'HOST': 'localhost',
},
'cassandra': {
'ENGINE': 'django_cassandra_engine',
'NAME': 'app',
'HOST': '127.0.0.1',
'OPTIONS': {
'replication': {
'strategy_class': 'SimpleStrategy',
'replication_factor': 1
},
'connection': {
'consistency': ConsistencyLevel.LOCAL_ONE,
'port': 9042,
'retry_connect': True
# + All connection options for cassandra.cluster.Cluster()
},
'session': {
'default_timeout': 10,
'default_fetch_size': 10000
# + All options for cassandra.cluster.Session()
}
}
}
}
的runserver,執行syncdb工作正常。當我訪問索引頁面時彈出錯誤。
有什麼我做錯了嗎?
感謝提前:)
/薩哈
難道你不能刪除'default'整體嗎? – makaveli
我也這麼想過。但顯然這是不可能的。它需要一個默認的空或不是。如果我刪除默認,我得到KeyError:'默認' –