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