私のプロジェクトでDjango 1.8とMongoDBを使用しています。誰かが私を修正助けることができる Mongod.exeDjango mongodb - settings.DATABASESが正しく設定されていません
:私は、データベースに接続することができますが、私はviews.pyに何かをしたいとき、私はこのエラーを取得しています:
ImproperlyConfigured at /make_histograms
settings.DATABASES is improperly configured. Please supply the ENGINE value.
Check settings documentation for more details.
Request Method: POST
Request URL: http://127.0.0.1:8000/make_histograms
Django Version: 1.8
Python Executable: G:\Stamp 2\VENV2\Scripts\python.exe
Python Version: 2.7.12
Python Path: ['G:\\Stamp 2\\znaczki2', 'G:\\Stamp 2\\VENV2\\Scripts\\python27.zip', 'G:\\Stamp 2\\VENV2\\DLLs', 'G:\\Stamp 2\\VENV2\\lib', 'G:\\Stamp 2\\VENV2\\lib\\plat-win', 'G:\\Stamp 2\\VENV2\\lib\\lib-tk', 'G:\\Stamp 2\\VENV2\\Scripts', 'c:\\python27\\Lib', 'c:\\python27\\DLLs', 'c:\\python27\\Lib\\lib-tk', 'G:\\Stamp 2\\VENV2', 'G:\\Stamp 2\\VENV2\\lib\\site-packages']
Server time: Tue, 20 Dec 2016 17:23:38 +0100
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'app')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware')
Traceback:
File "G:\Stamp 2\VENV2\lib\site-packages\django\core\handlers\base.py" in get_response
132.response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "G:\Stamp 2\VENV2\lib\site-packages\django\views\decorators\csrf.py" in wrapped_view
58. return view_func(*args, **kwargs)
File "G:\Stamp 2\znaczki2\app\views.py" in make_histograms
62. example.save()
File "G:\Stamp 2\VENV2\lib\site-packages\django\db\models\base.py" in save
710. force_update=force_update, update_fields=update_fields)
File "G:\Stamp 2\VENV2\lib\site-packages\django\db\models\base.py" in save_base
735. with transaction.atomic(using=using, savepoint=False):
File "G:\Stamp 2\VENV2\lib\site-packages\django\db\transaction.py" in __enter__
150. if not connection.get_autocommit():
File "G:\Stamp 2\VENV2\lib\site-packages\django\db\backends\base\base.py" in get_autocommit
286. self.ensure_connection()
File "G:\Stamp 2\VENV2\lib\site-packages\django\db\backends\dummy\base.py" in complain
21. raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
Exception Type: ImproperlyConfigured at /make_histograms
Exception Value: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
しかし、私はMongoDBの接続が正常であることを確認しますこの問題? settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.dummy',
}
}
_MONGODB_USER = 'marcin'
_MONGODB_PASSWD = '1234'
_MONGODB_HOST = 'localhost'
_MONGODB_NAME = 'znaczki'
_MONGODB_DATABASE_HOST = \
'mongodb://%s:%[email protected]%s/%s' \
% (_MONGODB_USER, _MONGODB_PASSWD, _MONGODB_HOST, _MONGODB_NAME)
mongoengine.connect(_MONGODB_NAME, host=_MONGODB_DATABASE_HOST)
で
マイデータベースsectiion
? – ettanany
@ettanany DATABASES = { 'デフォルト':{ 'ENGINE': 'django.db.backends.dummy'、 }} – BigTrunk98
あなたがのsettings.pyするモンゴの設定を追加しましたか? – ettanany