Password string comparison in Django app

后端 未结 2 1408
萌比男神i
萌比男神i 2021-01-24 17:43

It\'s impossible to get passwords of a user in any Django app, by design.

I\'m implementing a change password feature for my Django app, and one of the req

2条回答
  •  耶瑟儿~
    2021-01-24 18:21

    Following on from my suggestion under e4c5's answer, it would appear as though there are existing packages such as Django Password Validator that will do this for you so you don't really need to write it yourself.

    Essentially, it seems that this works via storing the previously used hashed passwords in a database and then comparing the new hashed password to those currently stored.

    See the source code for their validator for more information.

提交回复
热议问题