在Django中我使用的两个应用程序:如何访问多个数据库在Django使用SQLite 3
- 蟒蛇manage.py的startApp书
- 蟒蛇manage.py的startApp接触
不过我我只使用书籍应用程序模型。所以我用DATABASE_NAME
,如:
DATABASE_NAME = 'C:/WorkBase/Python/first/books/book.db'
现在我想用第二个联系人应用程序模型。如何将联系人应用程序模型添加到DATABASE_NAME?我的INSTALLED_APPS
看起来像这样。
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'first.books',
'first.contacts',
)
注:我正在使用SQLite 3作为数据库。
请参阅http://stackoverflow.com/questions/168218/is-it-possible-to-have-separate-sqlite-databases-within-the-same-django-project – Martin 2009-10-28 05:01:28
我错误地问了这个问题。 – Beginner 2009-10-28 15:51:38