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

21.5 Disabling Accounts

Before we create new user accounts, we first see how to disable user accounts.

When building a website, the ideal in usability is to first disable a user account and then delete the account some time later. Disabling an account means ensuring the user may no longer log in. Out of the box, Django immediately supports both disabling and deleting user accounts. Deleting an account is so straightforward and simple (particularly in our case), that we look only at disabling an account.

Unlike what it does for password management, Django does not supply any views for us to rely on when it comes to disabling a user account, so we must build our own view (Example 21.24). The idea is to build a page that disables the account of ...

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