Re: Using Multiple databases

2022-04-15 Thread Ryan Nowakowski
On Wed, Apr 06, 2022 at 08:59:09AM -0700, Vasanth Mohan wrote: > I'm building a PoC for a multi-tenant app where I'm trying to use the same > schema across multiple databases with Django instance. I've got a couple of > questions and I'd be happy to have some input > > 1. Is there a way to defin

Using Multiple databases

2022-04-06 Thread Vasanth Mohan
Hello, I'm building a PoC for a multi-tenant app where I'm trying to use the same schema across multiple databases with Django instance. I've got a couple of questions and I'd be happy to have some input 1. Is there a way to define the *using()* function to use with Models via a lib/middleware

call the model of the secondary database in djnago using Multiple Databases

2020-06-30 Thread Pradyum Gupta
https://stackoverflow.com/q/62658396/7999665 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion o

Re: Single Django App using Multiple Databases

2018-10-02 Thread heriberto ochoa
https://django-tenant-schemas.readthedocs.io/en/latest/ El martes, 2 de octubre de 2018, 6:53:16 (UTC-6), Glen D souza escribió: > > Hi, > > I am working on a project where i am using a single django app which is > backed by different databases. > > Let me explain the use case clearly, > > I have

Single Django App using Multiple Databases

2018-10-02 Thread Glen D souza
Hi, I am working on a project where i am using a single django app which is backed by different databases. Let me explain the use case clearly, I have a app say app1, and app1 data is located in two different databases say db1 and db2 data present in the db1 and db2 are different, lets say db1 h

Re: Managing transactions using multiple databases

2013-07-08 Thread Leandro Boscariol
Amazing work Christophe, congrats! Lot's of new cool stuff being added to 1.6, looking forward to it. Regarding the nested xact context managers, let's say something that I don't like happened and I want to abort everything: with xact(using=db1): with xact(using=db2): obj1 = Ob1.save(

Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus
On Jul 6, 2013, at 8:58 PM, Leandro Boscariol wrote: > And also thanks for mentioning xact, I wasn't aware of that! Full disclosure: I wrote it. :) In 1.6, the new atomic() decorator / context manager is the way to go, but xact() works fine for now! -- -- Christophe Pettus x...@thebuild.com

Re: Managing transactions using multiple databases

2013-07-06 Thread Leandro Boscariol
Well, even though without true two-phase commit, for now that will do, thanks. And also thanks for mentioning xact, I wasn't aware of that! Cheers, Leandro On Saturday, July 6, 2013 10:41:11 AM UTC-3, Christophe Pettus wrote: > > > On Jul 6, 2013, at 2:54 PM, Leandro Boscariol wrote: > > > How

Re: Managing transactions using multiple databases

2013-07-06 Thread Christophe Pettus
On Jul 6, 2013, at 2:54 PM, Leandro Boscariol wrote: > How can I do a transaction management in both databases at the same time? Is > that even possible? You can certainly nest the transaction context managers (atomic() in 1.6+, or you can use xact() in 1.5 and earlier): with xact(using=DA

Managing transactions using multiple databases

2013-07-06 Thread Leandro Boscariol
Hello, During the design of a project, I came across a situation where I will have 2 databases. Not a big deal, it is very well documented in Django docs . Dealing with transactions

Re: Problems on using multiple databases

2011-08-24 Thread Jianbao Tao
Reinout, Thanks so much for your help. I think I have figured out the solution. I posted it on https://groups.google.com/forum/?hl=en#!topic/django-users/zwMWNdIqB3A. Please take a look. Jianbao On Wed, Aug 24, 2011 at 10:13 AM, Reinout van Rees wrote: > On 24-08-11 17:57, Jianbao Tao wrote: >

Re: Problems on using multiple databases

2011-08-24 Thread Reinout van Rees
On 24-08-11 17:57, Jianbao Tao wrote: Now './manage.py syncdb' can run through with no problems. However, it doesn't create the database 'test.sqlite', which means the models in the app, books, are still installed in the default database. That's in the django docs: syncdb only managed the main

Re: Problems on using multiple databases

2011-08-24 Thread Jianbao Tao
Thank you, Reinout. I changed the definition of 'allow_syncdb' to the following: def allow_syncdb(self, db, model): # db is a string of database name. label = model._meta.app_label if label == 'books': dbName = 'test' else: dbName = None

Re: Problems on using multiple databases

2011-08-24 Thread Reinout van Rees
On 23-08-11 01:31, Jim wrote: django.db.utils.DatabaseError: no such table: django_content_type Which django version, btw? Early 1.2 beta versions had a bug: https://code.djangoproject.com/ticket/12999 Reinout -- Reinout van Reeshttp://reinout.vanrees.org/ rein...@vanree

Re: Problems on using multiple databases

2011-08-24 Thread Reinout van Rees
On 23-08-11 01:31, Jim wrote: def allow_syncdb(self, db, model): # db is a string of database name. label = model._meta.app_label if label == 'books': dbName = 'test' else: dbName = None return dbName == db I'd do the "

Re: Problems on using multiple databases

2011-08-23 Thread Jim
Still stuck on this problem. Can anybody help me out, please? It would be much appreciated. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/K9twgNZcE4IJ. T

Problems on using multiple databases

2011-08-22 Thread Jim
Hello folks, I am learning to set up multiple databases routing in Django. Before I started, I had everything working properly. Then, I wrote dbrouter.py under the site directory, basically by copying the example in the Django document about using multiple databases<ht

Django Using Multiple Databases in a Web Application

2008-11-06 Thread [EMAIL PROTECTED]
Hi, Django Users, Started on Django and enjoying this framework immensley, Using the DjangoProject Documentation and the book The Definitive Guide to Django Web Development Done Right, I am starting a project but I want to use more that one sqlite database. From the Docs\Book it appears that you

Re: Using multiple databases

2008-07-21 Thread Ben Ford
It won't be in 1.0. It's only really been kicked off recently, so you'll have to wait a while :-) 2008/7/21 CPF_ <[EMAIL PROTECTED]>: > > Ben Ford wrote: > > Hi There, > > > > It has been possible in the past to use multiple databases with > > django. There was a branch for it and about a year ag

Re: Using multiple databases

2008-07-21 Thread Amirouche
Have a look a this http://code.djangoproject.com/ticket/4747 & http://trac.woe-beti.de/ On 21 juil, 03:04, CPF_ <[EMAIL PROTECTED]> wrote: > Ben Ford wrote: > > Hi There, > > > It has been possible in the past to use multiple databases with > > django. There was a branch for it and about a year a

Re: Using multiple databases

2008-07-20 Thread CPF_
Ben Ford wrote: > Hi There, > > It has been possible in the past to use multiple databases with > django. There was a branch for it and about a year ago it was bought > up to date with trunk. However that branch hasn't seen any activity > for some time and is effectively dead. There's now a (lo

Re: Using multiple databases

2008-07-20 Thread Ben Ford
Hi There, It has been possible in the past to use multiple databases with django. There was a branch for it and about a year ago it was bought up to date with trunk. However that branch hasn't seen any activity for some time and is effectively dead. There's now a (low key) effort under way to come

Re: Using multiple databases

2008-07-20 Thread CPF_
[EMAIL PROTECTED] wrote: > Dan wrote: >> >> Most ideally we would like to have it so that the application >> uses DB1 >> (defined in the settings.py file) as the main database, but when >> it's >> down to users, uses DB2.user as the users table. >> Currently we are thinking of us

Re: Using multiple databases

2008-07-18 Thread [EMAIL PROTECTED]
Dan wrote: > > Most ideally we would like to have it so that the application uses DB1 > (defined in the settings.py file) as the main database, but when it's > down to users, uses DB2.user as the users table. > Currently we are thinking of using raw sql, but that would only be a >

Re: Using multiple databases

2008-07-18 Thread Dan
> Most ideally we would like to have it so that the application uses DB1 > (defined in the settings.py file) as the main database, but when it's > down to users, uses DB2.user as the users table. > Currently we are thinking of using raw sql, but that would only be a > last resort preferably. And at

Using multiple databases

2008-07-18 Thread CPF_
Hi, I'm currently starting a project in django, and there's some data already in another database. We're planning to go and use that information (more specifically user information) in the django application. However, this forms several problems: 1) There are 2 different databases. A django setti

Re: using multiple databases

2007-09-18 Thread Ben Ford
You can use the multi-db branch as is and use it for a different app for each db if you want as per the instructions. However you'll lose a lot of the recent functionality from trunk that way. I'd suggest checking out trunk at r 6100 and then patching against that. Contact me off list and I'll send

Re: using multiple databases

2007-09-18 Thread msoulier
On Sep 17, 11:00 pm, "Ben Ford" <[EMAIL PROTECTED]> wrote: > Hi Mike, > There is a branch that supports multiple databases in the repository. It's > quite out of date in the SVN repo but Koen put in some stirling work over > the period of the sprint and produced a patch against trunk at around r61

Re: using multiple databases

2007-09-17 Thread Ben Ford
Hi Mike, There is a branch that supports multiple databases in the repository. It's quite out of date in the SVN repo but Koen put in some stirling work over the period of the sprint and produced a patch against trunk at around r6100. Multiple-db support is a feature that is asked for very regularl

using multiple databases

2007-09-17 Thread msoulier
I was hoping to use Django in a web management UI for a server that I support, where new UIs are added as new applications are installed. Due to this plugin requirement, I had planned to model that with one large Django project, where each new plugin was a Django application. Unfortunately it wou