Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 73d0800839
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (27 sloc) 0.928 kB
from django.contrib.sites.models import Site
class DbMap(dict):
def __getitem__(self, key):
return {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'django_achtung',
'USER': 'root',
'PASSWORD': 'ran32dom',
'HOST': '',
'PORT': '',
'init_command': 'SET storage_engine=INNODB',
class DomainRouter(object):
"""A router to control which database is used by which domain"""
def get_db_from_domain(self):
print Site.objects.get_current()
return 'default'
def db_for_read(self, model, **hints):
return self.get_db_from_domain()
def db_for_write(self, model, **hints):
return self.get_db_from_domain()
def allow_relation(self, obj1, obj2, **hints):
return None
def allow_syncdb(self, db, model):
return True
Jump to Line
Something went wrong with that request. Please try again.