我收到以下错误: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:'默认' –