title
Python Django Tutorial: Full-Featured Web App Part 12 - Email and Password Reset

description
In this Python Django Tutorial, we will be learning how we can use email to send a password reset link to a user so that the user can reset their password. Users will be able to fill out a form with their email and have a unique token sent to them, and if their token is verified then they will be able to create a new password. Let's get started... The code for this series can be found at: https://github.com/CoreyMSchafer/code_snippets/tree/master/Django_Blog Localhost Email Setup: https://docs.djangoproject.com/en/2.1/topics/email/#configuring-email-for-development ✅ Support My Channel Through Patreon: https://www.patreon.com/coreyms ✅ Become a Channel Member: https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join ✅ One-Time Contribution Through PayPal: https://goo.gl/649HFY ✅ Cryptocurrency Donations: Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3 Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33 Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot ✅ Corey's Public Amazon Wishlist http://a.co/inIyro1 ✅ Equipment I Use and Books I Recommend: https://www.amazon.com/shop/coreyschafer ▶️ You Can Find Me On: My Website - http://coreyms.com/ My Second Channel - https://www.youtube.com/c/coreymschafer Facebook - https://www.facebook.com/CoreyMSchafer Twitter - https://twitter.com/CoreyMSchafer Instagram - https://www.instagram.com/coreymschafer/ #Python #Django

detail
{'title': 'Python Django Tutorial: Full-Featured Web App Part 12 - Email and Password Reset', 'heatmap': [{'end': 815.402, 'start': 720.347, 'weight': 0.705}, {'end': 952.717, 'start': 902.131, 'weight': 0.817}], 'summary': 'In this tutorial, the chapter demonstrates generating a secure token for password reset, sending email instructions, creating confirmation and password reset routes, addressing errors in the process, discussing url security parameters, setting up email functionality using gmail, and creating a password reset feature with django.', 'chapters': [{'end': 189.805, 'segs': [{'end': 27.24, 'src': 'embed', 'start': 0.209, 'weight': 0, 'content': [{'end': 5.851, 'text': "Hey there, how's it going everybody? In this video, we'll be learning how to use email to allow users to reset their passwords.", 'start': 0.209, 'duration': 5.642}, {'end': 13.174, 'text': 'So Django has built-in functionality that can generate a secure token to ensure that only a specific user can reset their password.', 'start': 6.211, 'duration': 6.963}, {'end': 19.336, 'text': "And then we'll see how we can send an email to Django that has instructions for a user to reset their password.", 'start': 13.594, 'duration': 5.742}, {'end': 20.937, 'text': "So let's go ahead and get started.", 'start': 19.656, 'duration': 1.281}, {'end': 27.24, 'text': "So we're going to go back into our projectsurls.py module and add some more built-in Django views.", 'start': 21.437, 'duration': 5.803}], 'summary': 'Demonstrating how to use email for password reset in django.', 'duration': 27.031, 'max_score': 0.209, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w209.jpg'}, {'end': 165.991, 'src': 'embed', 'start': 140.717, 'weight': 3, 'content': [{'end': 145.639, 'text': 'So that is here in our users app and in our user templates.', 'start': 140.717, 'duration': 4.922}, {'end': 153.804, 'text': "So in our users templates, I'm going to create a new template here and I'm going to call this password underscore reset dot HTML.", 'start': 145.94, 'duration': 7.864}, {'end': 157.727, 'text': "And within this template, we're going to have a form for filling out our email address.", 'start': 154.144, 'duration': 3.583}, {'end': 161.289, 'text': "So I'm going to grab one of our other templates as a starting point.", 'start': 158.047, 'duration': 3.242}, {'end': 165.991, 'text': 'So I think the login route would be a good starting point.', 'start': 161.569, 'duration': 4.422}], 'summary': 'Creating a new password reset template for email address form.', 'duration': 25.274, 'max_score': 140.717, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w140717.jpg'}], 'start': 0.209, 'title': "Using django's built-in functionality for password reset", 'summary': 'Demonstrates generating a secure token for password reset, sending email instructions, and creating password reset route and template within the users app, with built-in django views and necessary form adjustments.', 'chapters': [{'end': 115.016, 'start': 0.209, 'title': 'Using email for password reset', 'summary': "Demonstrates how to use django's built-in functionality to generate a secure token for password reset and send an email with instructions, while also adding built-in django views for password reset urls.", 'duration': 114.807, 'highlights': ['Django has built-in functionality to generate a secure token for password reset. Django has built-in functionality that can generate a secure token to ensure that only a specific user can reset their password.', 'Demonstration of using built-in Django views for password reset URLs. Adding built-in Django views for password reset URLs, including creating a URL pattern for password reset and using password reset view from auth views.', 'Demonstrating the process of sending an email with instructions for password reset. The chapter explains how to send an email to Django with instructions for a user to reset their password.']}, {'end': 189.805, 'start': 115.336, 'title': 'Creating password reset route and template', 'summary': 'Covers the process of creating a password reset route and template within the users app, including specifying the template, creating a new template, and making necessary form adjustments.', 'duration': 74.469, 'highlights': ['The process involves providing a form for users to fill out to send a password reset instruction to their email, within the users app and in the user templates.', "The chapter specifies the creation of a new template called 'password_reset.html' and involves making adjustments to the form, such as changing the legend to 'reset password' and the button to 'request password reset'."]}], 'duration': 189.596, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w209.jpg', 'highlights': ['Django has built-in functionality to generate a secure token for password reset.', 'Demonstration of using built-in Django views for password reset URLs.', 'Demonstrating the process of sending an email with instructions for password reset.', 'The process involves providing a form for users to fill out to send a password reset instruction to their email.', "The chapter specifies the creation of a new template called 'password_reset.html' and involves making adjustments to the form."]}, {'end': 427.432, 'segs': [{'end': 216.191, 'src': 'embed', 'start': 189.845, 'weight': 0, 'content': [{'end': 195.406, 'text': "So I'm just going to remove that div that is underneath our form and save that.", 'start': 189.845, 'duration': 5.561}, {'end': 200.787, 'text': "Okay. So now that we've created that path with the built-in view and also created the template,", 'start': 195.746, 'duration': 5.041}, {'end': 204.948, 'text': 'we also need to create the page for after this form is submitted successfully.', 'start': 200.787, 'duration': 4.161}, {'end': 210.39, 'text': 'So this will just be a route that confirms that the email has been sent and tells you to check your inbox.', 'start': 205.308, 'duration': 5.082}, {'end': 212.21, 'text': 'So we need to create that.', 'start': 210.73, 'duration': 1.48}, {'end': 216.191, 'text': "So let's open up our URLs module again here.", 'start': 212.61, 'duration': 3.581}], 'summary': 'Removing div, creating path, template, and route for successful email submission', 'duration': 26.346, 'max_score': 189.845, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w189845.jpg'}, {'end': 303.787, 'src': 'embed', 'start': 231.508, 'weight': 1, 'content': [{'end': 239.193, 'text': 'OK, so that looks a little strange, but at least you all can see everything on the screen at the same time if I do it this way.', 'start': 231.508, 'duration': 7.685}, {'end': 246.377, 'text': 'OK, so like I said, this next route is just going to be the page for when our password reset form is submitted successfully.', 'start': 239.633, 'duration': 6.744}, {'end': 251.2, 'text': 'And this route will just confirm that the email has been sent and tell us to check our inbox.', 'start': 246.778, 'duration': 4.422}, {'end': 258.105, 'text': 'So we can set this equal to password reset forward slash done as the URL.', 'start': 251.58, 'duration': 6.525}, {'end': 265.048, 'text': 'For the route that we want to handle this, this is going to be password reset done view.', 'start': 258.964, 'duration': 6.084}, {'end': 272.012, 'text': "The name of the template that we're going to use is password underscore reset underscore done dot html.", 'start': 265.408, 'duration': 6.604}, {'end': 278.295, 'text': 'And the name that we will use for this route is going to be password underscore reset underscore done.', 'start': 272.672, 'duration': 5.623}, {'end': 282.277, 'text': "So now let's create a template for this password reset done view.", 'start': 278.615, 'duration': 3.662}, {'end': 286.779, 'text': "So again, in our user templates, let's create this.", 'start': 282.737, 'duration': 4.042}, {'end': 294.042, 'text': 'So I will create a template in here called password underscore reset underscore done dot HTML.', 'start': 287.179, 'duration': 6.863}, {'end': 297.244, 'text': 'So in here, this is just going to be an informative page.', 'start': 294.483, 'duration': 2.761}, {'end': 300.285, 'text': "There aren't going to be forms or anything like that in here.", 'start': 297.284, 'duration': 3.001}, {'end': 303.787, 'text': 'So I think we can just copy the logout template.', 'start': 300.725, 'duration': 3.062}], 'summary': 'Setting up a route and template for password reset confirmation page.', 'duration': 72.279, 'max_score': 231.508, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w231508.jpg'}, {'end': 418.927, 'src': 'embed', 'start': 388.666, 'weight': 3, 'content': [{'end': 394.811, 'text': 'And if we look in the place where the actual error occurred, which is down here in this template rendering,', 'start': 388.666, 'duration': 6.145}, {'end': 404.157, 'text': "then we can see that it occurred because it's trying to create a URL to this password reset confirm route with these weird values here.", 'start': 395.171, 'duration': 8.986}, {'end': 410.361, 'text': 'And the name of the template that threw this error is called password reset email dot HTML.', 'start': 404.517, 'duration': 5.844}, {'end': 418.927, 'text': 'So that is a template that Django is using in the background to create the email to send to the user so that they can reset their password.', 'start': 410.762, 'duration': 8.165}], 'summary': "Error occurred in template rendering while creating a url for password reset confirm route with weird values; django using 'password reset email dot html' template to create email for password reset.", 'duration': 30.261, 'max_score': 388.666, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w388666.jpg'}], 'start': 189.845, 'title': 'Creating confirmation and password reset routes', 'summary': 'Covers creating a confirmation page for successful form submission by modifying an existing route and creating a password reset route and template, as well as addressing errors in the process and the need for a password reset confirm route.', 'chapters': [{'end': 230.747, 'start': 189.845, 'title': 'Creating success confirmation page', 'summary': 'Discusses creating a route and page for confirming the successful submission of a form, including copying an existing route and modifying it to create the confirmation page.', 'duration': 40.902, 'highlights': ['Creating a route for confirming successful form submission by copying an existing route and modifying it', 'Removing a div underneath a form to make changes', 'Creating a path with a built-in view and template for the form']}, {'end': 427.432, 'start': 231.508, 'title': 'Password reset route and template', 'summary': 'Explains the creation of a route for a successful password reset submission and the associated template, along with the identification of an error in the process, and the need for the password reset confirm route.', 'duration': 195.924, 'highlights': ['The chapter explains the creation of a route for a successful password reset submission and the associated template, along with the identification of an error in the process, and the need for the password reset confirm route.', "The route for successful password reset submission is set as 'password reset/done' with the corresponding view and template named 'password_reset_done.html'.", 'The creation of a template for the password reset done view involves using an informative page with a bootstrap alert confirming the email has been sent for password reset.', "An error occurs during the process when attempting to reference a non-existing path for the password reset confirm route, leading to the identification of the template 'password_reset_email.html' as the source of the error."]}], 'duration': 237.587, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w189845.jpg', 'highlights': ['Creating a route for confirming successful form submission by copying an existing route and modifying it', "The route for successful password reset submission is set as 'password reset/done' with the corresponding view and template named 'password_reset_done.html'", 'The creation of a template for the password reset done view involves using an informative page with a bootstrap alert confirming the email has been sent for password reset', "An error occurs during the process when attempting to reference a non-existing path for the password reset confirm route, leading to the identification of the template 'password_reset_email.html' as the source of the error", 'Removing a div underneath a form to make changes', 'Creating a path with a built-in view and template for the form', 'The chapter explains the creation of a route for a successful password reset submission and the associated template, along with the identification of an error in the process, and the need for the password reset confirm route']}, {'end': 651.654, 'segs': [{'end': 501.384, 'src': 'embed', 'start': 427.432, 'weight': 0, 'content': [{'end': 434.196, 'text': "and not only is it trying to access that route, but it's also trying to pass two different things into the url parameters.", 'start': 427.432, 'duration': 6.764}, {'end': 442.101, 'text': 'so one of those things is called this uidb64 and the other parameter is one called token.', 'start': 434.196, 'duration': 7.905}, {'end': 452.868, 'text': 'Now, these are two parameters that we need to accept in our URL so that we know that the user who requested the password reset is the person trying to access that page.', 'start': 442.601, 'duration': 10.267}, {'end': 456.551, 'text': "So basically it's adding a layer of security to these routes.", 'start': 453.228, 'duration': 3.323}, {'end': 463.195, 'text': "The UI DB 64 is the user's ID encoded in base 64.", 'start': 457.011, 'duration': 6.184}, {'end': 467.159, 'text': 'And the token is the token to check that the password is valid.', 'start': 463.195, 'duration': 3.964}, {'end': 470.541, 'text': 'And these are required since the view is expecting them.', 'start': 467.659, 'duration': 2.882}, {'end': 474.124, 'text': "So let me create this route that it's looking for.", 'start': 470.962, 'duration': 3.162}, {'end': 477.287, 'text': 'And this will make more sense once we see this in action.', 'start': 474.605, 'duration': 2.682}, {'end': 478.788, 'text': 'So, like I said before,', 'start': 477.667, 'duration': 1.121}, {'end': 486.394, 'text': 'these error pages are very useful for following the trail of exactly what changes we need to make in order to get things working.', 'start': 478.788, 'duration': 7.606}, {'end': 491.939, 'text': "So to add this route, let's pull up our project URLs module again.", 'start': 486.795, 'duration': 5.144}, {'end': 496.841, 'text': 'So I will pull this up and go to our other two routes here.', 'start': 492.299, 'duration': 4.542}, {'end': 501.384, 'text': 'And now we need to create a route for password reset confirm.', 'start': 497.302, 'duration': 4.082}], 'summary': 'Adding route for password reset confirm with uidb64 and token parameters for security.', 'duration': 73.952, 'max_score': 427.432, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w427432.jpg'}, {'end': 651.654, 'src': 'embed', 'start': 584.295, 'weight': 2, 'content': [{'end': 587.877, 'text': 'And this one is going to have a form for us to actually reset our password.', 'start': 584.295, 'duration': 3.582}, {'end': 590.539, 'text': "So let's copy one of the templates with a form.", 'start': 588.237, 'duration': 2.302}, {'end': 594.401, 'text': "And I'm just going to use the password reset form as a starting point.", 'start': 590.859, 'duration': 3.542}, {'end': 602.105, 'text': "So back in our password reset template, I'm going to copy that and paste that into our password reset confirm template.", 'start': 594.741, 'duration': 7.364}, {'end': 606.748, 'text': "And the only thing that I'm going to change in here is the text that is on our submit button.", 'start': 602.485, 'duration': 4.263}, {'end': 612.532, 'text': 'So instead of request password reset, this is actually going to be the form that resets our password.', 'start': 607.068, 'duration': 5.464}, {'end': 617.376, 'text': "So I'm just going to say, let's see, reset password.", 'start': 612.652, 'duration': 4.724}, {'end': 625.582, 'text': 'Okay, so now that we have that password reset, confirm route that that password reset email template was trying to create.', 'start': 617.796, 'duration': 7.786}, {'end': 630.604, 'text': "Now let's try to resubmit our password reset form and see what we get.", 'start': 626.002, 'duration': 4.602}, {'end': 636.727, 'text': 'So I will go back to the browser here and reload our password reset page.', 'start': 630.984, 'duration': 5.743}, {'end': 641.949, 'text': "And now let's submit the password reset for that email one more time.", 'start': 637.287, 'duration': 4.662}, {'end': 645.351, 'text': "Okay, so we're still getting an error, but this is a different error.", 'start': 642.33, 'duration': 3.021}, {'end': 647.532, 'text': 'This says connection refused.', 'start': 645.711, 'duration': 1.821}, {'end': 651.654, 'text': 'Now this error is less helpful than most of the other error pages.', 'start': 647.892, 'duration': 3.762}], 'summary': 'Developing a password reset form, encountering connection error.', 'duration': 67.359, 'max_score': 584.295, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w584295.jpg'}], 'start': 427.432, 'title': 'Url security and password reset confirm route', 'summary': "Covers the necessity of url security parameters, including uidb64 and token, to add security to routes. it also discusses the process of adding a password reset confirm route, encountering a 'connection refused' error during the process.", 'chapters': [{'end': 478.788, 'start': 427.432, 'title': 'Url security parameters', 'summary': "Discusses the necessity of accepting uidb64 and token as url parameters to add a layer of security to the routes, with uidb64 being the user's id encoded in base 64 and the token serving as a validity check for the password.", 'duration': 51.356, 'highlights': ["The UIDB64 and token parameters are necessary for adding a layer of security to the routes, with UIDB64 being the user's ID encoded in base 64 and the token serving as a validity check for the password.", 'Accepting uidb64 and token as URL parameters helps ensure that the user requesting the password reset is indeed the person attempting to access the page.']}, {'end': 651.654, 'start': 478.788, 'title': 'Adding password reset confirm route', 'summary': "Discusses adding a password reset confirm route, creating a route for password reset confirm, setting the view and template for the route, and submitting the password reset form, encountering a 'connection refused' error.", 'duration': 172.866, 'highlights': ["The chapter discusses creating a route for password reset confirm, specifying the URL and its parameters, setting the view and template for the route, and creating a form for resetting the password, with the submit button text changed to 'reset password'.", 'The error pages are useful for tracing necessary changes, indicating the need to make changes in order to get things working.', "The transcript also mentions encountering a 'connection refused' error after attempting to submit the password reset form.", 'The chapter explains the process of copying and pasting an existing password reset route to create a new one for password reset confirm, and creating a template for the confirm route with a form for resetting the password.']}], 'duration': 224.222, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w427432.jpg', 'highlights': ["The UIDB64 and token parameters are necessary for adding a layer of security to the routes, with UIDB64 being the user's ID encoded in base 64 and the token serving as a validity check for the password.", 'Accepting uidb64 and token as URL parameters helps ensure that the user requesting the password reset is indeed the person attempting to access the page.', "The chapter discusses creating a route for password reset confirm, specifying the URL and its parameters, setting the view and template for the route, and creating a form for resetting the password, with the submit button text changed to 'reset password'.", 'The chapter explains the process of copying and pasting an existing password reset route to create a new one for password reset confirm, and creating a template for the confirm route with a form for resetting the password.', 'The error pages are useful for tracing necessary changes, indicating the need to make changes in order to get things working.', "The transcript also mentions encountering a 'connection refused' error after attempting to submit the password reset form."]}, {'end': 968.794, 'segs': [{'end': 720.007, 'src': 'embed', 'start': 692.831, 'weight': 0, 'content': [{'end': 696.373, 'text': 'and it also gives us a practice of actually sending emails.', 'start': 692.831, 'duration': 3.542}, {'end': 703.017, 'text': "But just in case, I'm also going to link to the Django documentation on how to set this up on your local host,", 'start': 696.814, 'duration': 6.203}, {'end': 704.978, 'text': 'just in case some of you want to do it that way.', 'start': 703.017, 'duration': 1.961}, {'end': 708.06, 'text': "But with that said, in this video, I'm going to be using Gmail.", 'start': 705.279, 'duration': 2.781}, {'end': 710.202, 'text': 'Okay, so to do this with Gmail?', 'start': 708.541, 'duration': 1.661}, {'end': 717.246, 'text': 'depending on how your account is set up, you might have to let Google know to expect sign-ins from a Python application.', 'start': 710.202, 'duration': 7.044}, {'end': 720.007, 'text': 'So let me pull up my browser to show you this.', 'start': 717.646, 'duration': 2.361}], 'summary': 'Demonstrates setting up email functionality with gmail and local host using django.', 'duration': 27.176, 'max_score': 692.831, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w692831.jpg'}, {'end': 753.399, 'src': 'embed', 'start': 730.37, 'weight': 2, 'content': [{'end': 737.572, 'text': "Now, if you don't have two factor authentication, then you can just tell Google to allow sign ins from less secure apps.", 'start': 730.37, 'duration': 7.202}, {'end': 742.514, 'text': 'But if you do have two factor authentication which I have and which I would highly recommend,', 'start': 737.952, 'duration': 4.562}, {'end': 750.458, 'text': 'by the way then you can create a password specifically for the application that you want to sign in from, and that is what I did.', 'start': 742.514, 'duration': 7.944}, {'end': 753.399, 'text': 'so the link to do this is the third link down here.', 'start': 750.458, 'duration': 2.941}], 'summary': 'Enable two-factor authentication and create app-specific password for secure sign-ins.', 'duration': 23.029, 'max_score': 730.37, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w730370.jpg'}, {'end': 833.822, 'src': 'heatmap', 'start': 720.347, 'weight': 1, 'content': [{'end': 724.268, 'text': 'So I have searched Google app passwords here.', 'start': 720.347, 'duration': 3.921}, {'end': 729.95, 'text': 'And by searching that, there are instructions for how to sign into your Google account through different applications.', 'start': 724.608, 'duration': 5.342}, {'end': 737.572, 'text': "Now, if you don't have two factor authentication, then you can just tell Google to allow sign ins from less secure apps.", 'start': 730.37, 'duration': 7.202}, {'end': 742.514, 'text': 'But if you do have two factor authentication which I have and which I would highly recommend,', 'start': 737.952, 'duration': 4.562}, {'end': 750.458, 'text': 'by the way then you can create a password specifically for the application that you want to sign in from, and that is what I did.', 'start': 742.514, 'duration': 7.944}, {'end': 753.399, 'text': 'so the link to do this is the third link down here.', 'start': 750.458, 'duration': 2.941}, {'end': 760.023, 'text': 'that says app passwords, sign in, and the other two pages up here are just two links with instructions,', 'start': 753.399, 'duration': 6.624}, {'end': 763.064, 'text': "and they'll just link you to that third page eventually anyway.", 'start': 760.023, 'duration': 3.041}, {'end': 770.468, 'text': 'so I already went through that process and have put my password for this Django app in a private environment variable on my machine.', 'start': 763.064, 'duration': 7.404}, {'end': 779.013, 'text': 'So once you have gone through those Google instructions that allow you to sign into your Gmail through a Python application and you have all that set up,', 'start': 770.828, 'duration': 8.185}, {'end': 784.176, 'text': 'then now we can open our projects settings.py file and set a few variables.', 'start': 779.013, 'duration': 5.163}, {'end': 795.524, 'text': "So I can open our projects settings.py and I'm going to scroll all the way to the bottom to set a few more variables here that will set up our email.", 'start': 784.497, 'duration': 11.027}, {'end': 815.402, 'text': "So I'm going to say email underscore backend is equal to and within a string here I'm going to say django.core.mail.backends.smtp.email.backend and check the casing on that.", 'start': 795.824, 'duration': 19.578}, {'end': 817.444, 'text': 'that is a class there at the end, okay.', 'start': 815.402, 'duration': 2.042}, {'end': 822.429, 'text': "and now I'm going to set an email underscore And these are all caps, by the way.", 'start': 817.444, 'duration': 4.985}, {'end': 830.098, 'text': 'So set an email host to smtp.gmail.com.', 'start': 822.849, 'duration': 7.249}, {'end': 833.822, 'text': 'And now we want an email underscore port.', 'start': 830.638, 'duration': 3.184}], 'summary': 'Set up google app passwords for gmail access in python app.', 'duration': 37.998, 'max_score': 720.347, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w720347.jpg'}, {'end': 952.717, 'src': 'heatmap', 'start': 902.131, 'weight': 0.817, 'content': [{'end': 905.714, 'text': 'And the environment variable that I set for this is email underscore password.', 'start': 902.131, 'duration': 3.583}, {'end': 909.117, 'text': 'pass and this email host user here.', 'start': 905.914, 'duration': 3.203}, {'end': 916.603, 'text': 'this is actually your login email address for Gmail, so be sure that you have an email address set for that value.', 'start': 909.117, 'duration': 7.486}, {'end': 923.149, 'text': 'so with those settings set, I should now be able to send an email with Django and get this password reset email.', 'start': 916.603, 'duration': 6.546}, {'end': 924.972, 'text': "So let's try this out.", 'start': 923.49, 'duration': 1.482}, {'end': 928.876, 'text': "So first of all, let's make sure that our dev server is still running, and it is.", 'start': 925.332, 'duration': 3.544}, {'end': 938.127, 'text': "So I'm gonna open up our browser, go back to the password reset page, try to send this to corymschafer at gmail.com again.", 'start': 928.896, 'duration': 9.231}, {'end': 939.669, 'text': 'I will submit that.', 'start': 938.607, 'duration': 1.062}, {'end': 946.391, 'text': 'And it took a little second there, but it says that an email has been sent with instructions to reset your email.', 'start': 940.945, 'duration': 5.446}, {'end': 952.717, 'text': 'Okay, so now if I open my Gmail, which I have open here in the browser, we can see that this has already come in.', 'start': 946.731, 'duration': 5.986}], 'summary': 'Successfully sent password reset email to corymschafer at gmail.com.', 'duration': 50.586, 'max_score': 902.131, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w902131.jpg'}, {'end': 938.127, 'src': 'embed', 'start': 909.117, 'weight': 3, 'content': [{'end': 916.603, 'text': 'this is actually your login email address for Gmail, so be sure that you have an email address set for that value.', 'start': 909.117, 'duration': 7.486}, {'end': 923.149, 'text': 'so with those settings set, I should now be able to send an email with Django and get this password reset email.', 'start': 916.603, 'duration': 6.546}, {'end': 924.972, 'text': "So let's try this out.", 'start': 923.49, 'duration': 1.482}, {'end': 928.876, 'text': "So first of all, let's make sure that our dev server is still running, and it is.", 'start': 925.332, 'duration': 3.544}, {'end': 938.127, 'text': "So I'm gonna open up our browser, go back to the password reset page, try to send this to corymschafer at gmail.com again.", 'start': 928.896, 'duration': 9.231}], 'summary': 'Configured email settings for sending password reset email via django.', 'duration': 29.01, 'max_score': 909.117, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w909117.jpg'}], 'start': 652.294, 'title': 'Setting up email with gmail and python', 'summary': 'Discusses setting up email functionality using gmail, emphasizing the process for a python application, detailing configurations, and achieving successful email sending via django.', 'chapters': [{'end': 710.202, 'start': 652.294, 'title': 'Setting up email with gmail', 'summary': 'Discusses setting up email functionality using gmail, highlighting the absence of an email server and presenting options for sending emails, with a preference for using gmail as a production example.', 'duration': 57.908, 'highlights': ['The chapter emphasizes the need for setting up an email server to send emails, with a focus on using Gmail as an example for production, which also allows practice in sending emails.', 'It mentions the possibility of setting up a local host as an email server with Django and provides a link to the Django documentation for that, catering to those who may prefer this method.']}, {'end': 968.794, 'start': 710.202, 'title': 'Setting up gmail for python application', 'summary': 'Outlines the process of setting up gmail for a python application, including creating app passwords, configuring settings.py file with smtp details, and testing email functionality, resulting in successfully sending a password reset email via django.', 'duration': 258.592, 'highlights': ['Creating app passwords for Google account allows sign-ins from less secure apps or specific application with two-factor authentication. Setting up app passwords for Google account, option for sign-ins from less secure apps, creating application-specific password with two-factor authentication.', 'Configuring settings.py file with email backend, host, port, and TLS settings, and using environment variables to store sensitive information like username and password. Setting email backend, host, port, and TLS, using environment variables to store sensitive information.', 'Successfully sending a password reset email via Django after setting up and testing the email functionality. Sending a password reset email via Django, successful testing of email functionality.']}], 'duration': 316.5, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w652294.jpg', 'highlights': ['The chapter emphasizes the need for setting up an email server to send emails, with a focus on using Gmail as an example for production, which also allows practice in sending emails.', 'Configuring settings.py file with email backend, host, port, and TLS settings, and using environment variables to store sensitive information like username and password. Setting email backend, host, port, and TLS, using environment variables to store sensitive information.', 'Creating app passwords for Google account allows sign-ins from less secure apps or specific application with two-factor authentication. Setting up app passwords for Google account, option for sign-ins from less secure apps, creating application-specific password with two-factor authentication.', 'Successfully sending a password reset email via Django after setting up and testing the email functionality. Sending a password reset email via Django, successful testing of email functionality.', 'It mentions the possibility of setting up a local host as an email server with Django and provides a link to the Django documentation for that, catering to those who may prefer this method.']}, {'end': 1491.407, 'segs': [{'end': 1252.217, 'src': 'embed', 'start': 1231.081, 'weight': 0, 'content': [{'end': 1241.649, 'text': "and lastly, if we fill out the new password so I'll do the old password of testing321, testing321 and reset password, then that resets our password.", 'start': 1231.081, 'duration': 10.568}, {'end': 1248.614, 'text': 'and now we get redirected to the password reset complete page, and this is the last page in that process.', 'start': 1241.649, 'duration': 6.965}, {'end': 1252.217, 'text': 'and from here we can click on sign in.', 'start': 1249.034, 'duration': 3.183}], 'summary': "After entering old password 'testing321', the password is reset, and user is redirected to complete page.", 'duration': 21.136, 'max_score': 1231.081, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w1231081.jpg'}, {'end': 1292.88, 'src': 'embed', 'start': 1266.907, 'weight': 1, 'content': [{'end': 1274.373, 'text': "we haven't actually created a link anywhere for the user to reset their password, and most web applications have this link on the login page,", 'start': 1266.907, 'duration': 7.466}, {'end': 1276.454, 'text': "since that's where they'll go to sign up.", 'start': 1274.733, 'duration': 1.721}, {'end': 1283.336, 'text': "So I'm going to put a link there for them to reset their password if they forgot it or just want to change it.", 'start': 1277.354, 'duration': 5.982}, {'end': 1286.778, 'text': "So let's go to the login template and put that there.", 'start': 1283.656, 'duration': 3.122}, {'end': 1288.158, 'text': "So I'm going to open this up.", 'start': 1286.918, 'duration': 1.24}, {'end': 1292.88, 'text': "I'm going to close down some of our tabs that we have loaded up here.", 'start': 1288.478, 'duration': 4.402}], 'summary': 'Adding a password reset link to the login page for user convenience.', 'duration': 25.973, 'max_score': 1266.907, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w1266907.jpg'}, {'end': 1457.762, 'src': 'embed', 'start': 1430.423, 'weight': 2, 'content': [{'end': 1435.429, 'text': "So when it comes to web applications, there's almost no limit to the improvements that you can continue to make.", 'start': 1430.423, 'duration': 5.006}, {'end': 1440.616, 'text': "So, for example, with this application, we'll go over how to write unit tests for this application.", 'start': 1435.77, 'duration': 4.846}, {'end': 1444.497, 'text': "We'll go over how to deploy this application on multiple different platforms.", 'start': 1440.976, 'duration': 3.521}, {'end': 1450.019, 'text': 'We could learn how to send longer running requests off to a message queue and make it asynchronous.', 'start': 1445.058, 'duration': 4.961}, {'end': 1453.261, 'text': 'We could add a commenting system, a search feature.', 'start': 1450.6, 'duration': 2.661}, {'end': 1457.762, 'text': 'There are just all kinds of things that we can do with this application in the near future.', 'start': 1453.621, 'duration': 4.141}], 'summary': 'Endless improvements for web app: unit tests, deployment, async requests, commenting, search.', 'duration': 27.339, 'max_score': 1430.423, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w1430423.jpg'}], 'start': 968.794, 'title': 'Creating password reset emails', 'summary': 'Discusses creating a password reset feature using django, including sending password reset emails, creating password reset links, and implementing the password reset process, outlining key steps and considerations for implementing a secure password reset functionality.', 'chapters': [{'end': 1491.407, 'start': 968.794, 'title': 'Creating password reset emails', 'summary': 'Discusses creating a password reset feature using django, including sending password reset emails, creating password reset links, and implementing the password reset process, outlining key steps and considerations for implementing a secure password reset functionality.', 'duration': 522.613, 'highlights': ['The process involves creating a password reset link and implementing the password reset process, ensuring security and user verification. The chapter discusses creating a password reset feature using Django, including sending password reset emails, creating password reset links, and implementing the password reset process, outlining key steps and considerations for implementing a secure password reset functionality.', 'The tutorial covers creating a password reset link and setting up the password reset complete page, enabling users to reset their passwords, enhancing user experience and security. The tutorial covers the creation of a password reset link, setting up the password reset complete page, and enabling users to reset their passwords, thereby enhancing user experience and security measures.', 'The chapter emphasizes the importance of password reset functionality and hints at future improvements such as unit tests, deployment, and additional features. The chapter emphasizes the importance of password reset functionality and hints at future improvements such as unit tests, deployment, and additional features, underlining the significance of continuous enhancements in web applications.']}], 'duration': 522.613, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/-tyBEsHSv7w/pics/-tyBEsHSv7w968794.jpg', 'highlights': ['The process involves creating a password reset link and implementing the password reset process, ensuring security and user verification.', 'The tutorial covers creating a password reset link and setting up the password reset complete page, enabling users to reset their passwords, enhancing user experience and security.', 'The chapter emphasizes the importance of password reset functionality and hints at future improvements such as unit tests, deployment, and additional features.']}], 'highlights': ['Django has built-in functionality to generate a secure token for password reset.', 'Demonstration of using built-in Django views for password reset URLs.', 'Demonstrating the process of sending an email with instructions for password reset.', 'The process involves providing a form for users to fill out to send a password reset instruction to their email.', "The chapter specifies the creation of a new template called 'password_reset.html' and involves making adjustments to the form.", 'Creating a route for confirming successful form submission by copying an existing route and modifying it', "The route for successful password reset submission is set as 'password reset/done' with the corresponding view and template named 'password_reset_done.html'", 'The creation of a template for the password reset done view involves using an informative page with a bootstrap alert confirming the email has been sent for password reset', "An error occurs during the process when attempting to reference a non-existing path for the password reset confirm route, leading to the identification of the template 'password_reset_email.html' as the source of the error", 'Removing a div underneath a form to make changes', 'Creating a path with a built-in view and template for the form', 'The chapter explains the creation of a route for a successful password reset submission and the associated template, along with the identification of an error in the process, and the need for the password reset confirm route', "The UIDB64 and token parameters are necessary for adding a layer of security to the routes, with UIDB64 being the user's ID encoded in base 64 and the token serving as a validity check for the password.", 'Accepting uidb64 and token as URL parameters helps ensure that the user requesting the password reset is indeed the person attempting to access the page.', "The chapter discusses creating a route for password reset confirm, specifying the URL and its parameters, setting the view and template for the route, and creating a form for resetting the password, with the submit button text changed to 'reset password'.", 'The chapter explains the process of copying and pasting an existing password reset route to create a new one for password reset confirm, and creating a template for the confirm route with a form for resetting the password.', 'The error pages are useful for tracing necessary changes, indicating the need to make changes in order to get things working.', "The transcript also mentions encountering a 'connection refused' error after attempting to submit the password reset form.", 'The chapter emphasizes the need for setting up an email server to send emails, with a focus on using Gmail as an example for production, which also allows practice in sending emails.', 'Configuring settings.py file with email backend, host, port, and TLS settings, and using environment variables to store sensitive information like username and password. Setting email backend, host, port, and TLS, using environment variables to store sensitive information.', 'Creating app passwords for Google account allows sign-ins from less secure apps or specific application with two-factor authentication. Setting up app passwords for Google account, option for sign-ins from less secure apps, creating application-specific password with two-factor authentication.', 'Successfully sending a password reset email via Django after setting up and testing the email functionality. Sending a password reset email via Django, successful testing of email functionality.', 'It mentions the possibility of setting up a local host as an email server with Django and provides a link to the Django documentation for that, catering to those who may prefer this method.', 'The process involves creating a password reset link and implementing the password reset process, ensuring security and user verification.', 'The tutorial covers creating a password reset link and setting up the password reset complete page, enabling users to reset their passwords, enhancing user experience and security.', 'The chapter emphasizes the importance of password reset functionality and hints at future improvements such as unit tests, deployment, and additional features.']}