Django: Getting Started Transcripts
Chapter: Users and Account Management
Lecture: Authorization templates
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
The login you've seen me use so far is the Django admin's login. Django provides stubs for doing a non admin area login but they have to be completed
0:11
to work. All of this is because your site is going to look the way you want, you don't want a Django look and field but you want your own
0:19
And in fact if you take a look at the admin, there's good reason for that. Django provides you some views but you have to write
0:27
your own templates for login, log out, password changes, and password resets packaged with Django is the contrib.auth
0:38
module which contains some views and corresponding URLs for a variety of your authentication needs.
0:45
You can include all of these with a single line which I'll show you in a minute. Take a look at this list.
0:52
Django provides a view for login and log out. Then two views for doing a password change the password change view,
0:59
displays the form prompting the user for a new password. While the password change done view is what gets shown to the user after their password
1:08
has been updated. There are then four views for doing password resets, password reset shows the form for the user to request a reset.
1:20
Password reset done shows the user that a reset request has been activated. This has a side effect of sending the user an email which contains a link.
1:30
The reset view is what is linked in the email and that link itself is a one time link where the user inputs a new password.
1:39
And then finally, the reset done view tells the user their reset is complete. Are you ready for this?
1:46
You're going to have to write templates for all eight of these? Nobody said user management was fun.