Re: Multiple Database Routing Based on Site

2011-09-02 Thread Mo Mughrabi
What I did is create an attribute in my models and called it model.py class Data(models.Model): # connection_name is my database name which points to the name from settings.py connection_name = "gis" name = models.CharField(max_length=50) area = models.IntegerField() and created a

Re: Multiple Database Routing Based on Site

2011-09-02 Thread Kevin
The only solution I can directly think of, since the SITE_ID is in settings.py would be to use some python logic to determine the database for that site. eg. if SITE_ID == 1: ... Database settings for site 1 here ... Use an if-then like this in your settings.py. Now if what your going after

Multiple Database Routing Based on Site

2011-09-01 Thread Terribyte
I had a kind of crazy idea and I wanted to bounce it off of some people with a lot more django experience than I. Here's my scenario... I would like 1 code base, this code base services potentially hundreds of businesses, each of which I want to have a copy of the same schema but with data only r