- You need to add your db
vo
to settings.
if you have your database settings like this
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(DIR, 'django.sqlite3'),
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
},
}
Add vo
database settings to it like this
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(DIR, 'django.sqlite3'),
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
},
# this your existing db
'vo': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(DIR, 'vo.sqlite'),
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
},
}
Then you can generate models automatically from the database.
$ ./manage.py inspectdb --database=vo > your_app/models.py
Configure database routers.
Check out: Using Django's Multiple Database Support
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…