Changing INSTALLED_APPS before syncdb on the fly

70 views
Skip to first unread message

Bernardo P.

unread,
Jul 4, 2012, 7:24:12 AM7/4/12
to django-d...@googlegroups.com
Hello,

I have the following scenario. I have multiple tenants on different databases, all sharing the same code base. Everytime there is a change on the models, I call south's migrate on each of the databases via a single command migrate_all_databases (which calls south's migrate and django's syncdb on every database). There is however a shared database, where all tenants have access to. I'd like this shared database to have different models than the models on the tenants, which would involve having two different settings for INSTALLED_APPS. I've tried simply changing this setting before calling the syncdb command on the code, but django complains it can't find the app I removed. Any suggestions?

Many thanks in advance!

charettes

unread,
Jul 4, 2012, 10:26:51 AM7/4/12
to django-d...@googlegroups.com
This list is for Django development only, please refer to the django-user list to get support in the future.

Take a look at database routers and the `allow_syncdb`[1] method to achieve that.

Simon

[1] https://docs.djangoproject.com/en/1.4/topics/db/multi-db/#allow_syncdb
Reply all
Reply to author
Forward
0 new messages