Via Klemens Mantzos on django-users:
If i do
python manage.py syncdb --database=default
before i sync the users database this error comes up (which seems ok to me):
django.db.utils.DatabaseError: (1146, "Table 'multidb_user.auth_permission' doesn't exist")
but if i do this:
python manage.py syncdb --database=users
i get that every time (no matter if django_content_type already exists in the default db or not):
django.db.utils.DatabaseError: (1146, "Table 'multidb_user.django_content_type' doesn't exist")
Router config
# don't know but OtherRouter is maybe obsolete.
DATABASE_ROUTERS = ['dbrouter.AuthRouter', 'dbrouter.OtherRouter']
project/dbrouter.py
class AuthRouter(object):
"""A router to control all database operations on models in
the contrib.auth application"""
....
def allow_syncdb(self, db, model):
"Make sure the auth app only appears on the 'credentials' db"
if db == 'users':
return model._meta.app_label == 'auth'
elif model._meta.app_label == 'auth':
return False
return None
class OtherRouter(object):
"""A router that sets up a simple master/slave configuration"""
...
def allow_syncdb(self, db, model):
"Explicitly put all models on all databases."
return True