简体   繁体   中英

Django one database for each application in the same project

I have a Django project that contains two applications App1 and App2

I have configured two databases DB1 and DB2

when I use python manage.py syncdb the tables corresponding to model of the two application are created in the first database

How can I configure Django to make the model of the first application goes to the first database and the model of the second application goes to the second database

您需要实现自动数据库路由

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM