From some forum I came to know that Multiple database support is added in Django at lower level, but the higher level apis are not added yet.
Can anyone please tell
From Django 1.2, it will support multiple databases. See: http://docs.djangoproject.com/en/dev/topics/db/multi-db/ Version 1.2 is now in beta
The most recent discussion I've seen on it was in the Proposal: user-friendly API for multi-database support django-developers thread, which also has an example of one way to use multiple databases using Managers in the original message.
I think you will have to resort to "raw sql" .. kinda thing ..
look here: http://docs.djangoproject.com/en/dev/topics/db/sql/
you need a "connection" to your other database,
if you look at django/db/__init__.py
around line 39 (in my version ..)
connection = backend.DatabaseWrapper(**settings.DATABASE_OPTIONS)
try to take it from there ..
P.S. I haven't really tried this or anything .. just trying to point in the general direction of what I think might solve your problem.
If you simply need multiple connections, you can do something like this:
from django.db import load_backend
myBackend = load_backend('postgresql_psycopg2') # or 'mysql', 'sqlite3', 'oracle'
myConnection = myBackend.DatabaseWrapper({
'DATABASE_HOST': '192.168.1.1',
'DATABASE_NAME': 'my_database',
'DATABASE_OPTIONS': {},
'DATABASE_PASSWORD': "",
'DATABASE_PORT': "",
'DATABASE_USER': "my_user",
'TIME_ZONE': "America/New_York",})
# Now we can do all the standard raw sql stuff with myConnection.
myCursor = myConnection.cursor()
myCursor.execute("SELECT COUNT(1) FROM my_table;")
myCursor.fetchone()