Django: Getting Started Transcripts
Chapter: Users and Account Management
Lecture: Email contents for reset email

Login or purchase this course to watch this video and the rest of the course contents.
0:00 The next template in the workflow is the template for the email that the user receives. That's called password reset email.
0:12 Unlike the other forms, this is not being shown on the web so it doesn't extend out the base HTML file.
0:19 You can get fancier than this and do multipart my messages. But I'm going to stick with plain text.
0:26 The entire document is wrapped in the auto escape tag with the argument off. In the chapter on templates,
0:33 I mentioned that Django automatically escapes all texts unless you tell it to do otherwise.
0:38 You don't want a random greater than sign in the text destroying your HTML. As this text is going to include a link,
0:46 turning the auto escape feature off means you'll get whatever is in the text as is.
0:52 The reset workflow provides some context that is useful when constructing the email, especially the link for the user.
1:01 It includes the protocol variable which is set to http or https depending on your site. The domain of your site and some data for the reset link.
1:17 That data gets used inside of a URL tag. The URL tag is used to look up the
1:23 URL where the user does the actual password reset that's called password reset confirm.
1:31 Password reset confirmed is passed to arguments from the context an encoded user id and a one time user token.

Talk Python's Mastodon Michael Kennedy's Mastodon