Created
November 14, 2013 18:43
-
-
Save artschwagerb/7472133 to your computer and use it in GitHub Desktop.
Database Routers (settings.py)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'anotherdatabase', | |
'USER': 'anotherusername', | |
'PASSWORD': 'anotherpassword', | |
'HOST': '192.168.1.1', | |
'PORT': '', | |
}, | |
'master': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'anotherdatabase', | |
'USER': 'anotherusername', | |
'PASSWORD': 'anotherpassword', | |
'HOST': '192.168.1.1', | |
'PORT': '', | |
}, | |
'slave1': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'anotherdatabase', | |
'USER': 'anotherusername', | |
'PASSWORD': 'anotherpassword', | |
'HOST': '192.168.1.2', | |
'PORT': '', | |
}, | |
'slave2': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'anotherdatabase', | |
'USER': 'anotherusername', | |
'PASSWORD': 'anotherpassword', | |
'HOST': '192.168.1.3', | |
'PORT': '', | |
}, | |
} | |
DATABASE_ROUTERS = ['my_project.routers.MasterSlaveRouter'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment