Django admin do not recognize superuser

16 Views Asked by At

so, in my project django, I have:

models.py

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

    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['username']

after creating a superuser and trying to login in django, I see the error: enter image description here

same will happen trying to login into my site, after using a view to login, I can see "USER DOES NOT EXIST" in admin login

1

There are 1 best solutions below

0
Mohamed ElKalioby On

I think because you are setting 'is_active' to False as default, while it shall be True