user
하위의 models.py
에서 AbstractUser를 import해서 UserModel
에 상속 받아온 뒤 python manage.py runsever
를 실행 해줬는데, 오류가 떴다.
SystemCheckError: System check identified some issues:
ERRORS:
auth.User.groups: (fields.E304) Reverse accessor 'Group.user_set' for 'auth.User.groups' clashes with reverse accessor for 'user.UserModel.groups'.
HINT: Add or change a related_name argument to the definition for 'auth.User.groups' or 'user.UserModel.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor 'Permission.user_set' for 'auth.User.user_permissions' clashes with reverse accessor for 'user.UserModel.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'auth.User.user_permissions' or 'user.UserModel.user_permissions'.
user.UserModel.groups: (fields.E304) Reverse accessor 'Group.user_set' for 'user.UserModel.groups' clashes
with reverse accessor for 'auth.User.groups'.
HINT: Add or change a related_name argument to the definition for 'user.UserModel.groups' or 'auth.User.groups'.
user.UserModel.user_permissions: (fields.E304) Reverse accessor 'Permission.user_set' for 'user.UserModel.user_permissions' clashes with reverse accessor for 'auth.User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'user.UserModel.user_permissions' or 'auth.User.user_permissions'.
django 문서를 찾아보니 settings.py
에 AUTH_USER_MODEL
를 추가해주지 않아서 그렇다고 한다.
추가해주자 !
# settings.py
AUTH_USER_MODEL = 'user.UserModel'
이렇게 추가시켜주면 잘 돌아간다!