django中实现密码加密
在utils_app\utils\ 中新建encryption.py# md5加密
import hashlib
from django.conf import settings
def md5(data):obj_md5hashlib.md5(settings.SECRET_KEY.encode(utf-8))obj_md5.update(data.encode(utf-8))return obj_md5.hexdigest()在视图中使用from utils_app…
2026/7/5 3:09:53