django中的密码验证返回false

问题描述 投票:-1回答:1

Jwt坏了,试图手动完成,但它仍然返回false

In [2]: me = User.objects.all()[1]

In [3]: me.password
Out[3]: 'password'

In [4]: me.username
Out[4]: 'cchilders'

In [5]: me.email
Out[5]: 'cchilders'

In [9]: me.check_password('password')
Out[9]: False
python django
1个回答
1
投票

密码应该哈希,调用set_password

me.set_password(‘password’)
me.check_password(‘password’)
© www.soinside.com 2019 - 2024. All rights reserved.