如何在没有用户模型的Django中快速加密密码字符串? [英] How to quickly encrypt a password string in Django without an User Model?
本文介绍了如何在没有用户模型的Django中快速加密密码字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
根据我目前的Django应用设置,是否有一个功能或片段,允许我查看加密的密码,给定原始字符串?我正在测试一些功能,这对我来说很有用。
Based on my current Django app settings, is there a function or a snippet that allows me to view the encrypted password, given a raw string? I am testing some functionality and this would be useful for me.
我正在寻找类似的东西:
I am looking for something like:
password = encrypt_raw_password("abcdef")
推荐答案
有一个小的util函数: make_password 。
There is a small util function just for that: make_password.
这篇关于如何在没有用户模型的Django中快速加密密码字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文