Django: Getting Started Transcripts
Chapter: Users and Account Management
Lecture: Reset email with console output config
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
To demonstrate the password reset, I'm going to use the console based email back end To do that, I need to add some configuration to settings.py.
0:11
All the way at the bottom again and now the email back end property tells Django to use the console back end.
0:21
With this enabled, any email that gets sent will show up in the DEV console window.
0:27
Now let's go take care of all the templates that are necessary for password resets.
0:32
Remember I'm using Django's built in views and they expect these files to exist with exactly these names.
0:40
The first step in the workflow is the password reset form. This is where the user requests a password reset.
0:52
The form asks the user for their email address to kick off the reset workflow.
0:58
All of this of course is happening inside of our usual content block so that it maintains the look and feel of the website.
1:08
The first div here creates a smaller box to put the form in and the second aligns it in the center of the page. This is a purely cosmetic decision.
1:21
The main part of this page is the actual form like with the others you saw this one uses bootstraps form group.
1:27
The important part is the input field asking for an email. Also like the other forms, there are some conditional in here
1:34
to display errors if necessary. At the bottom, there is a submit button to finish it all off. When the user fills in this form,
1:43
Bootstrap has set up the HTML to validate on the client side whether or not the email address given is of the right form.
1:52
If it is then submit will be allowed. When the user submits the form, then Django checks whether or not the user's email is in the database.
2:03
If it is, an email gets sent to the user.