Django:懒惰加载installed_apps

时间:2018-02-06 15:38:10

标签: python django django-registration

我正在进行从Django 1.8到1.11的项目升级。他们使用了一个继承自Django Registration Redux包的自定义注册应用程序。 这两个软件包都列在installed_apps列表中。一切正常但是当我尝试运行测试时,它会在后面创建测试表,它在以下几行出错:

....
Creating table profile_preferences
Creating table registration_registrationprofile
Creating table registration_registrationprofile
django.db.utils.ProgrammingError: relation "registration_registrationprofile" already exists

这是因为两个应用程序都列在installed_apps列表中。有办法解决这个问题吗?

从installed_apps中删除django-registration-redux会导致RuntimeError: Model class registration.models.RegistrationProfile doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.错误。

0 个答案:

没有答案