from django.contrid.auth.hashers import make_password
password1 = request.data.get('password) # 获取密码 password = make_password(password1) # 加密