我正在使用django-allauth,其account
应用程序与我的account
应用程序冲突
我基于this solution为allauth.account创建了一个应用程序标签,从而解决了这个冲突
from django.apps import AppConfig
class AllAuthAccountConfig(AppConfig):
name = 'allauth.account'
label = 'allauth_account'
verbose_name = 'aullauth_account'
然后将其添加到已安装的应用程序中
INSTALLED_APPS = (
...,
'apps.allauth.apps.AllAuthAccountConfig',
...,
)
现在,当我尝试迁移时,会出现一个错误
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0001_initial, 0002_email_max_length in allauth_account).
To fix them run 'python manage.py makemigrations --merge'
但是python manage.py makemigrations --merge
也会失败,并出现以下错误:
ValueError: Could not find common ancestor of ['0001_initial', '0002_email_max_length']
如何更改allauth.account应用程序名称,使其不与我的应用程序或我的migations冲突
您可以使用django重命名应用程序包package link。我从未亲自使用过,但它似乎很好。你可以试试
相关问题 更多 >
编程相关推荐