Hash password

PHOTO EMBED

Wed Mar 31 2021 00:23:18 GMT+0000 (Coordinated Universal Time)

Saved by @pag0dy #django #python

if reg_form.is_valid():
            nuevo_usuario = reg_form.save(commit=False)
            pw_hash = bcrypt.hashpw(clave.encode(), bcrypt.gensalt()).decode() 
            nuevo_usuario.password = pw_hash
            nuevo_usuario.save()
content_copyCOPY