Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>my app name is blog synced with database alais user1 :</p> <pre><code>DATABASE_ROUTERS=['routers.BlogRouter'] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'mupltiple_datab_app1', # Or path to database file if using sqlite3. 'USER': 'root', # Not used with sqlite3. 'PASSWORD': 'admin', # Not used with sqlite3. 'HOST': "", # Set to empty string for localhost. Not used with sqlite3. 'PORT': "", # Set to empty string for default. Not used with sqlite3. }, 'user1':{ 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'mupltiple_datab_app2', # Or path to database file if using sqlite3. 'USER': 'root', # Not used with sqlite3. 'PASSWORD': 'admin', # Not used with sqlite3. 'HOST': "", # Set to empty string for localhost. Not used with sqlite3. 'PORT': "", } , 'user2':{ 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'mupltiple_datab_app3', # Or path to database file if using sqlite3. 'USER': 'root', # Not used with sqlite3. 'PASSWORD': 'admin', # Not used with sqlite3. 'HOST':"" , # Set to empty string for localhost. Not used with sqlite3. 'PORT': "" , } } </code></pre> <p>I am sure that there are a number of unexplored nuances to working with multiple databases in Django, and I admit I have not delved into the underlying code of this functionality, but for the time being everything seems to works as required. The really impressive part was seeing both apps in the admin without errors.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload