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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access