code

from .models import UserProfile
from django.contrib.auth.hashers import make_password
user_profile = UserProfile()
user_profile.username = username
user_profile.email = email
user_profile.password = make_password(password) #make_password是django自带的给password重新编码技术,存储在数据库中
user_profile.is_active = True #判断用户是否激活
user_profile.save()

 

 

 

 

 

 

 

 

相关文章:

  • 2021-05-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-08-18
猜你喜欢
  • 2022-12-23
  • 2021-12-22
  • 2021-11-02
  • 2022-12-23
  • 2021-12-18
  • 2021-05-07
  • 2021-12-06
相关资源
相似解决方案