S Gangs February 2016
Auto logout/destroy session after Password Change in Django
I am using django framework and I need to auto logout users after password changes (
not password reset via mail).
I am using django's :"
contrib.auth.views.password_change" to help me do this,
i.e., I'm not having a separate view and as a result I'm also using
password_change_done view of Django.
I need to know whether there's any way I can auto logout/destroy sessions after password change while using django's default views?
Aviah Laor February 2016
password_change has a post_change_redirect, so you can replace it:
from django.contrib.auth.views import password_change
from django.core.urlresolvers import reverse
Then in your urls.py, set my_password_change as the view that accepts the passowrd change request:
Asked in February 2016
Viewed 1,480 times
Answered 1 times
Leave an answer
Quote of the day: live life