django-multidb-router

Round-robin multidb router for Django 1.2
Download

django-multidb-router Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Jeff Balogh
  • Publisher web site:
  • http://mozilla.com

django-multidb-router Tags


django-multidb-router Description

Round-robin multidb router for Django 1.2 django-multidb-router is a Django application.With multidb.MasterSlaveRouter all read queries will go to a slave database; all inserts, updates, and deletes will do to the default database.First, define SLAVE_DATABASES in your settings. It should be a list of database aliases that can be found in DATABASES:DATABASES = { 'default': {...}, 'shadow-1': {...}, 'shadow-2': {...},}SLAVE_DATABASES = Then put multidb.MasterSlaveRouter into DATABASE_ROUTERS:DATABASE_ROUTERS = ('multidb.MasterSlaveRouter',)The slave databases will be chosen in round-robin fashion.If you want to get a connection to a slave in your app, use multidb.get_slave:from django.db import connectionsimport multidbconnection = connections Requirements: · Python · Django


django-multidb-router Related Software