错误信息:
1、django.db.utils.IntegrityError: (1215, u'Cannot add foreign key constraint')
2、RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.
3、migrate时后面加auth,报错django.db.utils.ProgrammingError: (1146, u"Table '**.django_site' doesn't exist")
解决办法:
1、删除掉本地migrations文件夹,重新migrations和migrate
2、注释
INSTALLED_APPS下面的home_application(app名称).然后migrations和migrate,之后
把home_applications解注释,再migrations 后面加上 home_application,
然后migrate。解决。
(继承auth的user,先注释掉account,下面调用auth这块也注释掉。然后migrate后,再生成account和home_application的表)