Answer the question
In order to leave comments, you need to log in
Why do I see the user's real password in the Django admin?
Why can I see the user's real password in the Django admin and database?
I just inherited from the base model, I did not change the password field.
Am I missing something?
Created users through the admin panel
class ChatUser(AbstractUser):
GENDER = [
('MALE', 'MALE'),
('FEMALE', 'FEMALE')
]
is_active = models.BooleanField(default=False)
gender = models.CharField(verbose_name='Gender', choices=GENDER, max_length=6)
birthdate = models.DateField(verbose_name='Birthdate', blank=True, null=True)
def __str__(self):
return self.username
Answer the question
In order to leave comments, you need to log in
In admin.py register the model correctly
https://stackoverflow.com/a/15013810
Because there is a separate method for setting the password, and not just assigning a value to the field.
How is this user created? And specifically how is the password set for it?
you need to explicitly call set_password for this:
user.set_password(пароль)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question