To set the password field in the django model field

Asked 2 years ago, Updated 2 years ago, 77 views

class AddId(models.Model):
    author = models.ForeignKey('auth.User')
    id = models.CharField(max_length=200)
    password = models.CharField(max_length=200)

def __str__(self):
    return self.id

In Janggo, we want a user named A to receive additional ID and password values (multiple IDs and passwords.

If you do that, you can add it, but if you look at the password part in the admin, can you make it look like a password in the admin?

I googling it, but it's hard to find it except for making it look like a '****' shape in the HTML hem. <

Masters, please.

django python

2022-09-21 19:05

1 Answers

The password must be encrypted using a hash value like md5 to protect the input string in a form that is not known to humans even if it is printed later. Since DB can see the value when stored as a normal string, it would be desirable to store passwords using an encryption algorithm that cannot be decrypted.


2022-09-21 19:05

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.