python - Auto logout/destroy session after Password Change in Django -


i using django framework , need auto logout users after password changes (not password reset via mail).

i using django's :"contrib.auth.views.password_change" me this,

i.e., i'm not having separate view , result i'm using password_change_done view of django.

i need know whether there's way can auto logout/destroy sessions after password change while using django's default views?

password_change has post_change_redirect, can replace it:

from django.contrib.auth.views import password_change django.core.urlresolvers import reverse  def my_password_change(request):     return password_change(request=request,post_change_redirect=reverse('logout')) 

then in urls.py, set my_password_change view accepts passowrd change request:

url(r'^password_change/done/$',my_password_change,name="my_password_change") 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -