Django makemigrations报错

Django python manage.py makemigrations

Django运行python manage.py makemigrations(记录对models.py的改动)时报错:

app01.MyUser.groups: (fields.E304) Reverse accessor for 'MyUser.groups' clashes with reverse accessor for 'User.groups'.

解决办法: settings.py中添加AUUTH_USER_MODEL

# settings.py

# app01是我的app名字,MyUser是我继承AbstractUser的表名字
AUTH_USER_MODEL = 'app01.MyUser'
posted @ 2019-10-15 19:06  17vv  阅读(552)  评论(1编辑  收藏  举报