X
X
xoolo2017-01-09 22:25:27
Django
xoolo, 2017-01-09 22:25:27

django working with multiple databases?

It is necessary to implement work with several bases in the application. how to specify for which base the model is created

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
un1t, 2017-01-09
@un1t

Did you read Doc?
https://docs.djangoproject.com/en/1.10/topics/db/m...
To do this, you need to make your own router.
https://docs.djangoproject.com/en/1.10/topics/db/m...
And there you can do it the way you want. You can write down the name of the database in the meta, for example. Or, directly in the router, make a model-base mapping.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question