Answer the question
In order to leave comments, you need to log in
How does Django access the second database?
Something in my head doesn’t fit how I can access an existing one from under Django (that is, a second or separate database). let's say there is a main site database (which Django created automatically) db.sqlite3.sqlite3? in settings it is written like this:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
},
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
},
'CSDNbd': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'BDtest'),
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question