Dans mon projet Django, j'ai un user_manage
app.
Je crée un modèle nommé UserManage
dans mon user_manage
model.py de l'application :
from django.db import models
from django.contrib.auth.models import AbstractUser
class UserManage(AbstractUser):
username = models.CharField(max_length=12)
Alors je cours :
$ python3 manage.py makemigrations
C'est là qu'intervient l'erreur :
ERRORS:
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'UserManage.groups'.
HINT: Add or change a related_name argument to the definition for 'User.groups' or 'UserManage.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'UserManage.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'UserManage.user_permissions'.
users_management.UserManage.groups: (fields.E304) Reverse accessor for 'UserManage.groups' clashes with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for 'UserManage.groups' or 'User.groups'.
users_management.UserManage.user_permissions: (fields.E304) Reverse accessor for 'UserManage.user_permissions' clashes with reverse accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'UserManage.user_permissions' or 'User.user_permissions'.
33 votes
Avez-vous mentionné
AUTH_USER_MODEL
sursettings.py
?