我有 Django 1.4 和 Python 2.6.6 当我使用“django-amdin.py startproject djproject”时,请按照网页 https://www.ibm.com/developerworks/cn/linux/l-django/#resources中的步骤操作 而我获取文件如下:
djproject/
|-- djproject
| |-- __init__.py
| |-- settings.py
| |-- urls.py
| `-- wsgi.py
`-- manage.py
注意:manage.py 和 other.py 文件不在同级文件夹,为什么?
++++++
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'db/tdata.db', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
当我将“ENGINE”配置为“sqlite3”而不是“django.db.backends.sqlite3”时,出现错误:
django.core.exceptions.ImproperlyConfigured: 'sqlite3' isn't an available database backend.
Try using django.db.backends.sqlite3 instead.
Error was: No module named base
这也是1.4的新角色吗?