Reputation: 1350
Using class based views kind of hide all the complexity in the django code so I prefer using the function based view then afterwards move to class based views.
Is there by any chance you can write a custom password reset view to change user's password either than using django's class based views? I am able to do it with class based views but understanding it, is a problem since all the complexity is hidden. If anyone has a link to an article explaining that in detail I would be glad since google is giving me nothing.
Upvotes: 0
Views: 533
Reputation:
Why do you need a separate function to change the user's password when you can use the Django built-in User model.
from django.contrib.auth.models import User
user = User.objects.get(username='your_user_name')
user.set_password('your_password')
user.save()
Practice DRY (Don't repeat yourself). If it is available built-in and is feasible you should go with it rather than reinventing it.
Cheers,
Ref: Django auth system
Upvotes: 1