まったくの初心者です、すいません
- Mac OSX 10.8 Python 2.7 (自作でインストール)
- PostgreSQL 9.4(自作でインストール)
- psycopg2 2.5 (macports でインストール)
- Django 1.0.4 (経由でインストール
python setup.py install
)
私はこのチュートリアルを使用しています。開始後、python manage.py shell
実行しました
>>> from django.db import connection
>>> cursor = connection.cursor()
そして以下を得ました:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/backends/dummy/base.py", line 15, in complain
raise ImproperlyConfigured("settings.DATABASES is improperly configured. "
ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details.
私の settings.py ファイルの DATABASES セクションは次のようになります。
DATABASE_ENGINE = 'django.db.backends.postgresql_psycopg2' #postgresql_psycopg2
DATABASE_NAME = 'mydatabase' #mydatabase
DATABASE_USER = 'sarahr6' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
では、なぜそれが不適切に構成されていると言われているのかわかりませんか?