tags:

views:

121

answers:

2

Hi,

Can any one point me to code where users can change their own passwords in Django?

Thanks.

+5  A: 

Django comes with a user authentication system. It handles user accounts, groups, permissions and cookie-based user sessions. This document explains how things work.

How to change Django passwords

See the Changing passwords section

The code example:

from django.contrib.auth.models import User
u = User.objects.get(username__exact='john')
u.set_password('new password')
u.save()
Svetlozar Angelov
+4  A: 

You can also just use the django.contrib.auth.views.password_change view in your URLconf. It uses a default form and template; supplying your own is optional.

Ben James