To fix this problem, here is what I did:
1) Find in your project all relationships with the foreign key, such as OneToOneField, ForeignKey and ManyToManyFields, including any reusable applications that reference auth.User or import the user and set him to settings.AUTH_USER_MODEL, as described above. With minimal use:
'auth.User'
2) For all models that have the above, make sure the models have a valid django migration (not south). If they have southern migrations, rename the directory to migrations_south, and then run the makemigrations command for this application:
./manage.py makemigrations affected_app
Sometimes there is a django migration folder under a different name, rather than default migrations . In such cases, specify this via MIGRATION_MODULES in your .py settings:
MIGRATION_MODULES = {'filer': 'filer.migrations_django'}
Since the problem is difficult to find in larger projects, I commented on all user applications in INSTALLED_APPS in settings.py and ran a test command, as it will start the migration and try to recreate the database for you:
./manage.py test
It looks like it fixed it for me. I'm not sure if step 1 is mandatory or just best practice. But you definitely need to convert applications to migration.
Hurrah!
PS. Get ready for what's coming in Django 1.9 . The syncdb command will be removed. The inherited method of synchronizing applications without migration is deleted, and migration is mandatory for all applications.
radtek Apr 22 '15 at 21:47 2015-04-22 21:47
source share