In your serializer or view before saving the user, set password by user.set_password(password_string) of which the password_string variable would hold the password of the user from the frontend. After which, you should save the user. user.save().
On Wed, Nov 2, 2022, 15:52 Saksham Khanal <saksham.khanal01@gmail.com> wrote:
when I try to new register new user form the API,the saved user doesn't have it's password hashed which is creating a problem while logging in.You can see the difference between admin and new_user.To create a user model I have inherited a Abstract user class.You can also check my register serializer
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d9adde23-46cd-40bf-babc-ced3d4b9d9ban%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/django-users/CADYqDX2Lns0t0H5gwyj7U%3Djpe7GgGVeLTE4TWRwqczvjg7iY2A%40mail.gmail.com.
No comments:
Post a Comment