Django: about an external database model

I am using the internal Django + database (mysql). but I need to query another external database (mysql). In case, can I make an external database model? The database already exists. Just need to request .. Thank you.

+4
source share
1 answer

I think you need to take a look at this documentation. It explains how to register multiple databases and then query them. https://docs.djangoproject.com/en/dev/topics/db/multi-db/ To be specific from which you are querying DB, you can go to this part of the document https://docs.djangoproject.com/en / dev / topics / db / multi-db / # manually-selecting-a-database-for-a-queryset

+2
source

Source: https://habr.com/ru/post/1392681/


All Articles