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) ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.