Reverse accessor for 'User.groups' clashes with reverse accessor for 'User.groups'.

I’m trying to start a new app (called jsnake) and when I try to run makemigrations for the first time I get:

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'. jsnake.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'. jsnake.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'.

The thing is, my models.py is so simple I don’t know how to fix this issue nor why it is happening:

from django.contrib.auth.models import AbstractUser
from django.db import models

class User(AbstractUser):
    pass

I’ve done this same process before in other projects with the models.py just like this one and didn’t face this problem. Why is this happening now? Did I miss something?

1 Like

The only thing that pops into my mind that might cause this, is that you haven’t added the AUTH_USER_MODEL setting into your settings.py file.

1 Like

Geez! Totally forgot to do that! Thanks a lot man

es correcto, muchas gracias

Greetings. Please am having this same issue and I have added the AUTH_USER_MODEL = inventors.User to my Application yet i get the same error. Any help?

This topic is marked as solved.

Please create a new post with all the relevant details. (At a minimum, your model and the complete error message you’re getting. We’ll move forward from there.)

Thanks very much your answer help me to solve my problem