Python/Django

[Python] Django 비밀번호 암호화해서 저장하기 set_password

insub4067 2021. 12. 16. 18:24
# user.forms.SignUpForm

def save(self, commit):
  username = self.cleaned_data.get("email")
  password = self.cleaned_data.get("password")
  user = super().save(commit=False)
  user.username = username
  user.set_password(password)
  user.save()

https://docs.djangoproject.com/en/4.0/ref/contrib/auth/

 

django.contrib.auth | Django documentation | Django

Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code Issues About ♥ Donate

docs.djangoproject.com