O'Reilly logo

Django Unleashed by Andrew Pinkham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

23.4.3 Adding a Change Password Page

While we can now easily add a user with a new password and a profile, we are currently unable to change a password in the admin. The goal of this section is to create a new page to change passwords. Creating a change password page is surprisingly difficult and requires a complete override of the ModelAdmin subclass.

To begin, we import a set of familiar tools, as shown in Example 23.34.

Example 23.34: Project Code

user/admin.py in 3ca4f2fbf7

 1   from django.conf.urls import url  .       ... 10   from django.contrib.messages import success 11   from django.core.exceptions import \ 12       PermissionDenied 13   from django.http import ( 14       Http404, HttpResponseRedirect) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required