Django Admin does not recognize superuser

well, after creating a superuser for my project and trying to login into admin/, I see the following error:
Captura de tela 2024-03-09 202508

my model for users is:

class User(AbstractUser):
    name = models.CharField(max_length=20,default= None)
    username = models.CharField(max_length=30,unique=True)
    email = models.EmailField(max_length=254, unique=True)
    password = models.CharField(max_length=30)
    is_active = models.BooleanField(default=False)

nothing more I think could be sending an error

in admin.py I have:

from django.contrib import admin
from .models import User 
from django.contrib.auth.admin import UserAdmin



admin.site.register(User)

That’s the wrong size field for a password. The AbstractBaseUser class defines password as max_length 128. You should not override that field.

See the docs at Password management in Django | Django documentation | Django

Beyond that, if you need further assistance with resolving this, please post the code being used to create these users.

I’ve noticed that I don’t even need a field password here. But thank you for this information

Anyway it’s not working, same error.