上错误:
(django_py3) huangdonglin@huangdonglin-virtual-machine:~/django_show/dailyfresh$ python manage.py makemigrations
SystemCheckError: System check identified some issues:
ERRORS:
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for 'User.groups' or 'User.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'User.user_permissions'.
user.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for 'User.groups' or 'User.groups'.
user.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'User.user_permissions'.
- 这里是因为要使用 django默认的认证系统(AbstractUser)在生成迁移文件之前,要先在settings文件里面做一个配置
# user代表应用 , User代表应用下的模型类
AUTH_USER_MODEL='user.User'
配置这里之后,就能接触,错误中的,冲突问题,迁移文件时,不会默认生成“ auth_user” 这张表而是生成 我们指定的这个模型类对应的表(看一下我的)。就不会冲突报错了。
- desc