I'm using Django 1.5 and Mysql 5.1 and am in the early stages of a multiple app 
development and the schema is changing frequently as "hidden" requirements 
emerge.  I cannot get syncdb to sync anything other than my default db, and 
when I change my default, it still seems to see the old one.   Here is 
settings.py, with some junk removed for brevity.  Routers.py is attached and is 
in the same directory as settings.  I cannot figure out what's going wrong with 
syncdb, but the normal application seems to work correctly.    I had commented 
out the "allow_syncdb" in the routers because I could not get it to work, it 
seems to have some impact but not sure what.

================settings.py=====================================
DATABASES = {
    'default': {'ENGINE': 'django.db.backends.mysql', 'NAME': 'accstaff'...    
},
    'wnr': {   'ENGINE': 'django.db.backends.mysql', NAME': 'wnr'...    },
    'accstaff': {        'ENGINE': 'django.db.backends.mysql', 'NAME': 
'accstaff'...    },
    'inserv': {  'ENGINE': 'django.db.backends.mysql', 'NAME': 'inserv'...    }
}

DATABASE_ROUTERS = ['AccWeeklyNursingReport.routers.WnrRouter',
                    'AccWeeklyNursingReport.routers.AccStaffRouter',
                    'AccWeeklyNursingReport.routers.AccInservRouter']

=====================================end settings.py===========================

The following is the output example

C:\all\django\AccWeeklyNursingReport>mysqladmin -f drop  accstaff
Database "accstaff" dropped

C:\all\django\AccWeeklyNursingReport>mysqladmin -f create  accstaff

C:\all\django\AccWeeklyNursingReport>python manage.py  syncdb 
--database=accstaff
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff sessions
allow syncdb for WnrRouter accstaff wnrapp
allow syncdb for WnrRouter accstaff wnrapp
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff sessions
allow syncdb for WnrRouter accstaff wnrapp
allow syncdb for WnrRouter accstaff wnrapp
Creating tables ...
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff contenttypes
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

C:\all\django\AccWeeklyNursingReport>echo DONE
DONE

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/DCD75728F460F14586086EA606E83082E71E861F%40ACEVXCHMBX1001.ADVENTISTCORP.NET.
For more options, visit https://groups.google.com/groups/opt_out.

Attachment: routers.py
Description: routers.py

Reply via email to