title
Build a User Login System With Flask-Login, Flask-WTForms, Flask-Bootstrap, and Flask-SQLAlchemy

description
In this video, I show you a more realistic example of how to use Flask-Login, Flask-WTForms, Flask-SQLAlchemy, and Flask-Bootstrap to build a registration and login system for users of your Flask app. This is something that is very common to web apps, so if you need to know how to handle users, this video will definitely help you. I'll show you: - How I used Flask-Bootstrap for my templates - How to integrate Flask-WTForms - How to add a SQLite database to save the users - How hash passwords using Werkzeug security - How to integrate Flask-Login to protect certain pages Need one-on-one help with your project? I can help through my coaching program. Learn more here: https://prettyprinted.com/coaching You can get the code here: https://prettyprinted.com/l/0GA Join my free course on the basics of Flask-SQLAlchemy: https://prettyprinted.com/flasksql Download a Flask cheatsheet here: http://prettyprinted.com/flaskcheatsheet Twitter: https://twitter.com/pretty_printed Github: https://github.com/prettyprinted

detail
{'title': 'Build a User Login System With Flask-Login, Flask-WTForms, Flask-Bootstrap, and Flask-SQLAlchemy', 'heatmap': [{'end': 997.34, 'start': 969.936, 'weight': 0.729}, {'end': 1145.413, 'start': 1115.675, 'weight': 1}], 'summary': 'Learn to create a user login system with flask using extensions like flask login, flask sql alchemy, flask wt forms, and flask bootstrap, covering functionalities such as signup, login, dashboard, and index page, web page creation, form conversion, login and registration form creation, form setup and testing, user table creation, registration, password hashing, flask login integration, and python flask login features.', 'chapters': [{'end': 105.675, 'segs': [{'end': 70.791, 'src': 'embed', 'start': 9.022, 'weight': 0, 'content': [{'end': 10.644, 'text': "Hey everyone, it's Anthony from PrettyBrenner here.", 'start': 9.022, 'duration': 1.622}, {'end': 17.832, 'text': "In today's video, I'll be showing you how to create a basic user login system that is going to use a few different Flask extensions.", 'start': 11.024, 'duration': 6.808}, {'end': 24.2, 'text': 'So those Flask extensions are Flask Login, Flask SQL Alchemy, Flask WT Forms, and Flask Bootstrap.', 'start': 17.893, 'duration': 6.307}, {'end': 30.606, 'text': "So, with those four extensions, we're gonna build this user login system that I will show you right now.", 'start': 24.641, 'duration': 5.965}, {'end': 32.506, 'text': "so it's going to have four sections to it.", 'start': 30.606, 'duration': 1.9}, {'end': 38.632, 'text': "it's going to have a dashboard, it's going to have this index page and it's also going to have a login form in a signup form.", 'start': 32.506, 'duration': 6.126}, {'end': 40.413, 'text': 'so the signup form is pretty simple.', 'start': 38.632, 'duration': 1.781}, {'end': 47.458, 'text': "I'll create a user, me, and then I'll put in my email and I'll create a password.", 'start': 40.413, 'duration': 7.045}, {'end': 50.02, 'text': "so I'll say password, sign up.", 'start': 47.458, 'duration': 2.562}, {'end': 63.267, 'text': 'it says new user has been created and then you can go log in and it redirects you to a dashboard and then you will see the name of the user that you logged in with,', 'start': 50.02, 'duration': 13.247}, {'end': 67.809, 'text': 'and then, of course, you can log out and it will redirect you back to the index page.', 'start': 63.267, 'duration': 4.542}, {'end': 70.791, 'text': "so that's what we're going to be building in this video.", 'start': 67.809, 'duration': 2.982}], 'summary': 'Anthony demonstrates creating a user login system using flask with four extensions: flask login, flask sql alchemy, flask wt forms, and flask bootstrap.', 'duration': 61.769, 'max_score': 9.022, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY9022.jpg'}], 'start': 9.022, 'title': 'Creating a user login system with flask', 'summary': 'Demonstrates building a user login system using flask extensions including flask login, flask sql alchemy, flask wt forms, and flask bootstrap, with functionalities such as signup, login, dashboard, and index page.', 'chapters': [{'end': 105.675, 'start': 9.022, 'title': 'Creating user login system with flask', 'summary': 'Demonstrates how to build a user login system using flask extensions including flask login, flask sql alchemy, flask wt forms, and flask bootstrap, with functionalities such as signup, login, dashboard, and index page.', 'duration': 96.653, 'highlights': ['The user login system utilizes Flask extensions including Flask Login, Flask SQL Alchemy, Flask WT Forms, and Flask Bootstrap. This highlights the key components used in building the user login system.', 'The system includes functionalities such as signup, login, dashboard, and index page. This emphasizes the specific functionalities that the user login system will possess.', 'The process involves creating a user, entering an email, and setting a password for signup. This provides insight into the specific steps involved in the signup process.', "The system redirects users to the dashboard upon logging in, displaying the user's name, and allows logging out to return to the index page. This details the actions and navigation flow within the user login system."]}], 'duration': 96.653, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY9022.jpg', 'highlights': ['The user login system utilizes Flask extensions including Flask Login, Flask SQL Alchemy, Flask WT Forms, and Flask Bootstrap.', 'The system includes functionalities such as signup, login, dashboard, and index page.', 'The process involves creating a user, entering an email, and setting a password for signup.', "The system redirects users to the dashboard upon logging in, displaying the user's name, and allows logging out to return to the index page."]}, {'end': 296.14, 'segs': [{'end': 168.573, 'src': 'embed', 'start': 123.568, 'weight': 0, 'content': [{'end': 128.632, 'text': "so if you want to pick up where I start, you can do that or you can just view the code when it's finished.", 'start': 123.568, 'duration': 5.064}, {'end': 133.157, 'text': "So here's what it looks like when the server is running.", 'start': 129.914, 'duration': 3.243}, {'end': 134.238, 'text': 'So I have a home page.', 'start': 133.177, 'duration': 1.061}, {'end': 135.879, 'text': 'I have a login page.', 'start': 134.838, 'duration': 1.041}, {'end': 137.78, 'text': 'I have a sign up page.', 'start': 135.899, 'duration': 1.881}, {'end': 139.521, 'text': 'And then I have a dashboard.', 'start': 138.3, 'duration': 1.221}, {'end': 142.363, 'text': 'And right now this is pretty simple stuff.', 'start': 140.022, 'duration': 2.341}, {'end': 148.567, 'text': "I'm not going to do anything special with the views.", 'start': 145.245, 'duration': 3.322}, {'end': 149.207, 'text': "It's just to..", 'start': 148.647, 'duration': 0.56}, {'end': 155.705, 'text': "kind of make our project look more real and make it more realistic, but it doesn't actually do anything.", 'start': 150.302, 'duration': 5.403}, {'end': 159.728, 'text': "It's better than showing just plain white HTML files.", 'start': 155.785, 'duration': 3.943}, {'end': 168.573, 'text': 'So the very first thing I need to do is I want to take these login forms, this login form and this signup form, and convert them to Flask WTF.', 'start': 160.988, 'duration': 7.585}], 'summary': 'Setting up server with home page, login, signup, and dashboard, aiming to convert forms to flask wtf.', 'duration': 45.005, 'max_score': 123.568, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY123568.jpg'}, {'end': 247.735, 'src': 'embed', 'start': 218.307, 'weight': 2, 'content': [{'end': 227.129, 'text': "I'm going to import three different fields that I'll be using between the two templates that I have a string field, a password field,", 'start': 218.307, 'duration': 8.822}, {'end': 232.187, 'text': "and I can't spell right now in a Boolean field.", 'start': 229.766, 'duration': 2.421}, {'end': 234.408, 'text': 'So the Boolean field will be for the checkbox.', 'start': 232.508, 'duration': 1.9}, {'end': 239.491, 'text': "And then while I'm at it, I'll import the validators that I'll use as well.", 'start': 236.209, 'duration': 3.282}, {'end': 241.752, 'text': 'So wtforms.validators.', 'start': 239.831, 'duration': 1.921}, {'end': 247.735, 'text': "I'm going to use input required as a validator.", 'start': 242.412, 'duration': 5.323}], 'summary': 'Importing three different fields: string, password, and boolean, along with validators.', 'duration': 29.428, 'max_score': 218.307, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY218307.jpg'}], 'start': 105.675, 'title': 'Web page creation and flask form conversion', 'summary': 'Covers creating web pages and a server with simple views, including a home page, login page, sign up page, and dashboard. it also outlines the process of converting login and signup forms to flask wtf, emphasizing the use of flask form over the form class and the importation of elements from the wt forms library.', 'chapters': [{'end': 149.207, 'start': 105.675, 'title': 'Creating web pages and server', 'summary': 'Involves creating web pages and a server, including a home page, login page, sign up page, and dashboard, with simple views, and providing access to the code for others to start from.', 'duration': 43.532, 'highlights': ['The chapter involves creating web pages and a server, including a home page, login page, sign up page, and dashboard, with simple views.', 'The author provides access to the code for others to start from.']}, {'end': 218.307, 'start': 150.302, 'title': 'Converting html forms to flask wtf', 'summary': 'Outlines the process of converting login and signup forms to flask wtf, emphasizing the use of flask form over the form class and the importation of elements from the wt forms library.', 'duration': 68.005, 'highlights': ['The chapter emphasizes the use of flask form over the form class when converting login and signup forms to Flask WTF.', "It is recommended to use flask form as per the developers' preference, even though form can still be utilized.", 'In addition to importing class form, the chapter highlights the necessity of importing elements from the WT forms library.']}, {'end': 296.14, 'start': 218.307, 'title': 'Importing fields and validators for wtforms', 'summary': 'Covers importing string, password, and boolean fields, as well as validators, for wtforms, emphasizing the simplicity of keeping everything in one file for an app expected to be relatively small, not exceeding 100 lines.', 'duration': 77.833, 'highlights': ['The chapter emphasizes importing string, password, and Boolean fields, as well as validators, for WTForms to be used in creating classes for forms.', 'The Boolean field will be used for the checkbox, and the chapter suggests importing the necessary validators like input required, email, and length.', 'It recommends keeping everything in one file for simplicity, especially for relatively small apps expected to be not more than 100 lines.']}], 'duration': 190.465, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY105675.jpg', 'highlights': ['The chapter involves creating web pages and a server, including a home page, login page, sign up page, and dashboard, with simple views.', 'The chapter emphasizes the use of Flask form over the form class when converting login and signup forms to Flask WTF.', 'The chapter emphasizes importing string, password, and Boolean fields, as well as validators, for WTForms to be used in creating classes for forms.']}, {'end': 636.404, 'segs': [{'end': 425.377, 'src': 'embed', 'start': 296.14, 'weight': 0, 'content': [{'end': 300.281, 'text': "so the very first thing I'll create is the login form.", 'start': 296.14, 'duration': 4.141}, {'end': 306.203, 'text': "so it inherits from flask form and it's going to have three fields.", 'start': 300.281, 'duration': 5.922}, {'end': 307.364, 'text': 'so let me go to the login form.', 'start': 306.203, 'duration': 1.161}, {'end': 313.816, 'text': 'I have the username field, the password field and the remember me filled.', 'start': 309.012, 'duration': 4.804}, {'end': 316.699, 'text': "so I'll create those three here.", 'start': 313.816, 'duration': 2.883}, {'end': 326.807, 'text': "so I'll create a username and it's going to be a string and the name of it is simply username,", 'start': 316.699, 'duration': 10.108}, {'end': 329.83, 'text': 'next out at the validators that are necessary for username.', 'start': 326.807, 'duration': 3.023}, {'end': 333.693, 'text': "so I'll say the validators are going to be input required.", 'start': 329.83, 'duration': 3.863}, {'end': 336.913, 'text': "I'll have a length for username.", 'start': 335.312, 'duration': 1.601}, {'end': 345.115, 'text': "So let's say the minimum length for my username is going to be 4 and the max length for a username is 15.", 'start': 336.913, 'duration': 8.202}, {'end': 350.036, 'text': "and Then I'll do something similar for password, but instead of a string it's going to be a password field.", 'start': 345.115, 'duration': 4.921}, {'end': 354.357, 'text': "I'll call it password and then I'll add validators for it.", 'start': 350.036, 'duration': 4.321}, {'end': 355.057, 'text': 'So once again,', 'start': 354.357, 'duration': 0.7}, {'end': 366.682, 'text': "I'll use input required because you have to have a password and then the length will be similar and I'll say minimum password length will be 8 and maximum password length will be 80..", 'start': 355.057, 'duration': 11.625}, {'end': 372.611, 'text': "And that 80 is a special number that I'll explain about later, but it's not important right now.", 'start': 366.682, 'duration': 5.929}, {'end': 375.536, 'text': "And then finally, I'll have the Remember Me checkbox.", 'start': 373.112, 'duration': 2.424}, {'end': 376.057, 'text': 'So remember..', 'start': 375.556, 'duration': 0.501}, {'end': 380.413, 'text': "It's going to be a Boolean field and I'll simply give it a name.", 'start': 377.691, 'duration': 2.722}, {'end': 382.455, 'text': "It doesn't need any other kind of validator on it.", 'start': 380.473, 'duration': 1.982}, {'end': 384.516, 'text': "So there's a login form.", 'start': 383.375, 'duration': 1.141}, {'end': 386.858, 'text': 'So I have the class in my flask app.', 'start': 384.857, 'duration': 2.001}, {'end': 394.124, 'text': 'Now I need to actually pass that class to my form or to the form in the template.', 'start': 387.279, 'duration': 6.845}, {'end': 402.966, 'text': 'And then I can use the flask bootstrap things to actually create the HTML for the form.', 'start': 396.283, 'duration': 6.683}, {'end': 408.929, 'text': "So first thing I'll do is I'll instantiate a form here in the login route, so I'll call it form.", 'start': 403.266, 'duration': 5.663}, {'end': 411.13, 'text': "It's going to be a login form.", 'start': 410.01, 'duration': 1.12}, {'end': 420.475, 'text': 'And then in my render template I will simply pass the form to the template so I can use it.', 'start': 413.191, 'duration': 7.284}, {'end': 425.377, 'text': 'So here was my login template I have.', 'start': 421.915, 'duration': 3.462}], 'summary': 'Created a login form with 3 fields: username, password, and remember me.', 'duration': 129.237, 'max_score': 296.14, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY296140.jpg'}, {'end': 610.739, 'src': 'embed', 'start': 579.439, 'weight': 3, 'content': [{'end': 583.561, 'text': 'So let me go to that one right now, the sign up username, email, password.', 'start': 579.439, 'duration': 4.122}, {'end': 588.642, 'text': 'So email will be a string field.', 'start': 586.481, 'duration': 2.161}, {'end': 590.403, 'text': "It doesn't matter what word you write these in.", 'start': 588.662, 'duration': 1.741}, {'end': 595.864, 'text': "I'm writing email first, even though on the form it's username first.", 'start': 590.463, 'duration': 5.401}, {'end': 597.745, 'text': 'So input required.', 'start': 596.704, 'duration': 1.041}, {'end': 610.739, 'text': 'And then it has the email validator, because supposed to be an email and I believe this should say message, so message.', 'start': 598.445, 'duration': 12.294}], 'summary': 'The form requires username, email, and password input, with email validation.', 'duration': 31.3, 'max_score': 579.439, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY579439.jpg'}], 'start': 296.14, 'title': 'Creating login and registration forms with flask', 'summary': 'Details the creation of a login form in flask with three fields - username, password, and remember me, along with form fields and validators, instantiation, passing forms to templates, and generating html for the forms.', 'chapters': [{'end': 372.611, 'start': 296.14, 'title': 'Creating login form with flask', 'summary': 'Details the creation of a login form in flask, with three fields - username, password, and remember me, with specific length and input requirements for each field.', 'duration': 76.471, 'highlights': ['The login form is created with three fields - username, password, and remember me, each with specific length and input requirements.', 'The username field has a minimum length of 4 and a maximum length of 15 characters, with input required validation.', 'The password field has a minimum length of 8 and a maximum length of 80 characters, with input required validation.']}, {'end': 636.404, 'start': 373.112, 'title': 'Flask form creation and html generation', 'summary': 'Covers the creation of login and registration forms using flask, including instantiation, passing forms to templates, and generating html for the forms, with a focus on form fields and validators.', 'duration': 263.292, 'highlights': ['Creation of registration form with email, username, and password fields The speaker creates a registration form with email, username, and password fields, including validators for email and maximum email length.', "Creation of login form with remember me checkbox The speaker creates a login form with a 'Remember Me' checkbox as a Boolean field and integrates it into the form generation process.", 'Instantiating and passing login form to template The speaker instantiates a login form in the login route and passes it to the template for use in form generation.']}], 'duration': 340.264, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY296140.jpg', 'highlights': ['The login form is created with three fields - username, password, and remember me, each with specific length and input requirements.', 'The username field has a minimum length of 4 and a maximum length of 15 characters, with input required validation.', 'The password field has a minimum length of 8 and a maximum length of 80 characters, with input required validation.', 'Creation of registration form with email, username, and password fields The speaker creates a registration form with email, username, and password fields, including validators for email and maximum email length.', "Creation of login form with remember me checkbox The speaker creates a login form with a 'Remember Me' checkbox as a Boolean field and integrates it into the form generation process.", 'Instantiating and passing login form to template The speaker instantiates a login form in the login route and passes it to the template for use in form generation.']}, {'end': 964.081, 'segs': [{'end': 719.568, 'src': 'embed', 'start': 677.437, 'weight': 0, 'content': [{'end': 687.406, 'text': "so method will be posts, action is going to be sign up and then i'll simply remove everything.", 'start': 677.437, 'duration': 9.969}, {'end': 691.21, 'text': 'so first thing i need is the hidden tag.', 'start': 687.406, 'duration': 3.804}, {'end': 693.532, 'text': 'so form dot, hidden tag.', 'start': 691.21, 'duration': 2.322}, {'end': 702.684, 'text': "then I'll add in the three things that I will have on this form, which are the username, the email and the password.", 'start': 695.663, 'duration': 7.021}, {'end': 719.568, 'text': "so form dots, username, form, email, and I'll wrap these in the form field function right now.", 'start': 702.684, 'duration': 16.884}], 'summary': 'Creating a sign-up form with username, email, and password fields.', 'duration': 42.131, 'max_score': 677.437, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY677437.jpg'}, {'end': 785.494, 'src': 'embed', 'start': 755.162, 'weight': 1, 'content': [{'end': 758.405, 'text': "but i'm not too concerned with that at the moment.", 'start': 755.162, 'duration': 3.243}, {'end': 766.012, 'text': 'so now that i have both forms working, i want to test and make sure i can actually post data and get the data from the form.', 'start': 758.405, 'duration': 7.607}, {'end': 771.925, 'text': "so the very first thing i'll do is I work with a login form, so", 'start': 766.012, 'duration': 5.913}, {'end': 776.868, 'text': 'I have my if statement here, which will check and see if the form was submitted,', 'start': 773.506, 'duration': 3.362}, {'end': 785.494, 'text': "and before I get to that I should put the methods on each one of the routes to be both get and post, because I'll be using the same route for both.", 'start': 776.868, 'duration': 8.626}], 'summary': 'Testing successful form submission and data retrieval using both get and post methods.', 'duration': 30.332, 'max_score': 755.162, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY755162.jpg'}, {'end': 907.636, 'src': 'embed', 'start': 881.725, 'weight': 3, 'content': [{'end': 889.051, 'text': "so now I'm going to do the same thing for the registration form, just to make sure everything is working correctly.", 'start': 881.725, 'duration': 7.326}, {'end': 890.171, 'text': 'this is something good to do,', 'start': 889.051, 'duration': 1.12}, {'end': 901.694, 'text': "because I've got into situations so many times where I'm just so confident that things work and I just write code without testing it and then I find out that one of the first things I wrote was all wrong and I have to go back and fix it.", 'start': 890.171, 'duration': 11.523}, {'end': 907.636, 'text': "so it's nice to test as you go along, even if it's not going to be what you actually end up using.", 'start': 901.694, 'duration': 5.942}], 'summary': 'Testing registration form to ensure correct functionality and prevent errors.', 'duration': 25.911, 'max_score': 881.725, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY881725.jpg'}], 'start': 636.404, 'title': 'Flask form setup & testing', 'summary': 'Covers setting up a signup form in flask with form register initialization, adding username, email, and password fields, and implementing form actions. it also discusses testing form submissions, emphasizing the importance of testing code during development.', 'chapters': [{'end': 755.162, 'start': 636.404, 'title': 'Flask signup form setup', 'summary': 'Outlines the process of setting up a signup form in flask, including initializing the form register, adding form fields for username, email, and password, and implementing form actions and methods, aiming to create a complete form for user signup.', 'duration': 118.758, 'highlights': ['The chapter covers initializing the form register, adding form fields for username, email, and password, and implementing form actions and methods.', "The speaker mentions setting the method as 'post' and action as 'sign up' for the form.", "The process involves using 'hidden tag' and 'form field function' to create the complete form for user signup."]}, {'end': 964.081, 'start': 755.162, 'title': 'Testing form submissions', 'summary': 'Discusses testing form submissions in flask, including checking and submitting form data for login and registration forms, and highlights the importance of testing code as you go along.', 'duration': 208.919, 'highlights': ['The chapter demonstrates checking and submitting form data for login and registration forms in Flask, ensuring the forms work correctly and returning submitted data.', 'The importance of testing code as you go along is emphasized to avoid issues and ensure that the code works as expected.', 'The process of testing form submissions in Flask is described, highlighting the need to test code as you go along to prevent potential errors and ensure functionality.']}], 'duration': 327.677, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY636404.jpg', 'highlights': ['The chapter covers initializing the form register, adding form fields for username, email, and password, and implementing form actions and methods.', 'The chapter demonstrates checking and submitting form data for login and registration forms in Flask, ensuring the forms work correctly and returning submitted data.', "The process involves using 'hidden tag' and 'form field function' to create the complete form for user signup.", 'The importance of testing code as you go along is emphasized to avoid issues and ensure that the code works as expected.', 'The process of testing form submissions in Flask is described, highlighting the need to test code as you go along to prevent potential errors and ensure functionality.', "The speaker mentions setting the method as 'post' and action as 'sign up' for the form."]}, {'end': 1536.261, 'segs': [{'end': 1001.182, 'src': 'heatmap', 'start': 969.936, 'weight': 1, 'content': [{'end': 973.458, 'text': "so by that i mean it's time to create the database.", 'start': 969.936, 'duration': 3.522}, {'end': 986.987, 'text': "so first thing i'll do i'll get out of this and i'll create a sqlite database and i'll call this database.db and i'll exit out of that.", 'start': 973.458, 'duration': 13.529}, {'end': 997.34, 'text': "so i should have the database created there and while i'm at it i'll create the uri for it.", 'start': 986.987, 'duration': 10.353}, {'end': 1001.182, 'text': 'so sql alchemy database.', 'start': 997.34, 'duration': 3.842}], 'summary': 'Creating a sqlite database called database.db and uri for sqlalchemy.', 'duration': 35.049, 'max_score': 969.936, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY969936.jpg'}, {'end': 1150.381, 'src': 'heatmap', 'start': 1108.513, 'weight': 0, 'content': [{'end': 1115.675, 'text': "so it's going to be a column with 50 characters and I want it to be unique as well.", 'start': 1108.513, 'duration': 7.162}, {'end': 1125.164, 'text': "and then finally, I have a password field and it's also going to be a string and in this case is going to be 80 characters long.", 'start': 1115.675, 'duration': 9.489}, {'end': 1130.386, 'text': "so I'll save that and now I will create this table by using create all.", 'start': 1125.164, 'duration': 5.222}, {'end': 1145.413, 'text': "so from app, import DB and I'll do DB, create all and then I'll Excel this and I'll open up the database and I'll do tables.", 'start': 1130.386, 'duration': 15.027}, {'end': 1150.381, 'text': "so I see the user table and if I select from this table, there's nothing.", 'start': 1145.413, 'duration': 4.968}], 'summary': "Creating a table with 50-character column and 80-character password, then verifying the table's creation and content.", 'duration': 41.868, 'max_score': 1108.513, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY1108513.jpg'}, {'end': 1385.596, 'src': 'embed', 'start': 1356.17, 'weight': 3, 'content': [{'end': 1371.897, 'text': "so then I'll say if the password from users so let's say user dot password is equal to the password they pass in, so the form password data.", 'start': 1356.17, 'duration': 15.727}, {'end': 1381.514, 'text': 'then I want to redirect them to the dashboard, meaning that they have logged in successfully and they can view the dashboard,', 'start': 1371.897, 'duration': 9.617}, {'end': 1385.596, 'text': "which is going to be the protected area, but it's not exactly protected yet.", 'start': 1381.514, 'duration': 4.082}], 'summary': 'Validating user login and redirecting to dashboard upon successful login.', 'duration': 29.426, 'max_score': 1356.17, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY1356170.jpg'}, {'end': 1505.009, 'src': 'embed', 'start': 1470.086, 'weight': 2, 'content': [{'end': 1474.71, 'text': 'So now I pretty much have the login route working as well.', 'start': 1470.086, 'duration': 4.624}, {'end': 1485.078, 'text': "And I won't have to do much to it except for add the security features to the login, which is something we can do right now.", 'start': 1475.23, 'duration': 9.848}, {'end': 1496.226, 'text': 'So first let me clear out the database that I have created just so I can redo it because it has that plain text password in there.', 'start': 1487.72, 'duration': 8.506}, {'end': 1498.148, 'text': "So I'll open up SQLite again.", 'start': 1496.667, 'duration': 1.481}, {'end': 1505.009, 'text': "then I'll delete from user.", 'start': 1501.287, 'duration': 3.722}], 'summary': 'Login route is almost complete. adding security features to login. clearing and resetting database.', 'duration': 34.923, 'max_score': 1470.086, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY1470086.jpg'}], 'start': 966.133, 'title': 'User table creation and registration', 'summary': 'Involves creating a user table in a sqlite database with unique fields for username and email, and an 80-character password field. it also focuses on implementing user registration and login functionality, emphasizing security features.', 'chapters': [{'end': 1130.386, 'start': 966.133, 'title': 'Creating a user table in a database', 'summary': 'Involves creating a user table in a sqlite database with fields for username, email, and password, where the username and email fields are set to be unique with specific character limits, and the password field is set to be 80 characters long.', 'duration': 164.253, 'highlights': ['A SQLite database is created and a URI for it is defined, with the user table being created and defined to have fields for username, email, and password, with specific character limits and unique constraints.', 'The user table is created with fields for ID, username, email, and password, setting username and email fields to be unique and with specific character limits, and the password field to be 80 characters long.']}, {'end': 1536.261, 'start': 1130.386, 'title': 'User registration and login implementation', 'summary': 'Focuses on implementing user registration and login functionality, including creating a new user in the database, allowing user registration, and validating user login credentials with redirection to the dashboard, with an emphasis on the security features.', 'duration': 405.875, 'highlights': ['User registration process involves creating a new user in the database by instantiating the user class and adding the user data to the database, with examples including username, email, and password. The user registration process involves instantiating the user class and adding user data to the database, including username, email, and password, with the password initially stored in plain text for testing purposes.', "Implementation of user login functionality involves querying the database for a user, checking if the password matches, and redirecting the user to the dashboard upon successful login. The user login functionality includes querying the database for a user, checking the password match, and redirecting to the dashboard upon successful login, while displaying 'invalid username or password' message for incorrect login credentials.", 'The emphasis is on adding security features to the login process, including hashing the password for improved security. The focus is on enhancing the security of the login process by adding features such as password hashing for improved security.']}], 'duration': 570.128, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY966133.jpg', 'highlights': ['The user table is created with fields for ID, username, email, and password, setting username and email fields to be unique and with specific character limits, and the password field to be 80 characters long.', 'A SQLite database is created and a URI for it is defined, with the user table being created and defined to have fields for username, email, and password, with specific character limits and unique constraints.', 'The emphasis is on adding security features to the login process, including hashing the password for improved security.', 'Implementation of user login functionality involves querying the database for a user, checking if the password matches, and redirecting the user to the dashboard upon successful login.']}, {'end': 1822.802, 'segs': [{'end': 1618.622, 'src': 'embed', 'start': 1536.261, 'weight': 0, 'content': [{'end': 1548.87, 'text': "so i'll start the app again and now to get it to work properly, where i have the hashing, i'll import from work search security.", 'start': 1536.261, 'duration': 12.609}, {'end': 1553.949, 'text': 'so work, serve that security.', 'start': 1548.87, 'duration': 5.079}, {'end': 1564.058, 'text': "I'm going to import two functions, once called generate password hash and the other one is going to be check password hash.", 'start': 1553.949, 'duration': 10.109}, {'end': 1565.56, 'text': "so they're pretty simple to use.", 'start': 1564.058, 'duration': 1.502}, {'end': 1573.827, 'text': 'as you can imagine, the generation will be in the registration view and then the check password will be in the login.', 'start': 1565.56, 'duration': 8.267}, {'end': 1575.289, 'text': "so let's do registration first.", 'start': 1573.827, 'duration': 1.462}, {'end': 1581.194, 'text': 'So the only change I have to make here is I have to actually generate the hash password.', 'start': 1576.67, 'duration': 4.524}, {'end': 1591.965, 'text': "So I'll create a variable here called hashed password, and I'll use the generate password hash function, and I'll pass in form.password.data.", 'start': 1581.214, 'duration': 10.751}, {'end': 1596.148, 'text': "And then the method I'll use is SHA-256.", 'start': 1593.306, 'duration': 2.842}, {'end': 1601.471, 'text': 'And this will generate a hash that is 80 characters long.', 'start': 1597.629, 'duration': 3.842}, {'end': 1605.433, 'text': "That's why I made the column in the database 80 characters long.", 'start': 1601.531, 'duration': 3.902}, {'end': 1610.336, 'text': "And that's why I made the form 80 characters, even though it won't matter so much on the form.", 'start': 1605.453, 'duration': 4.883}, {'end': 1616.02, 'text': "So now instead of passing in the plain text password, I'll change it to hash password.", 'start': 1611.117, 'duration': 4.903}, {'end': 1618.622, 'text': "So I'll save that and I'll give it a shot.", 'start': 1616.96, 'duration': 1.662}], 'summary': 'Imported security functions to hash and check passwords, generating 80-character hashes using sha-256.', 'duration': 82.361, 'max_score': 1536.261, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY1536261.jpg'}, {'end': 1685.665, 'src': 'embed', 'start': 1655.087, 'weight': 2, 'content': [{'end': 1662.451, 'text': 'So now let me check the password hash on the login route.', 'start': 1655.087, 'duration': 7.364}, {'end': 1670.356, 'text': "So here, instead of checking the password directly, so user.password, and then checking it against the password that's passed in,", 'start': 1663.993, 'duration': 6.363}, {'end': 1676.28, 'text': "what I'll do instead is I'll use the check password hash.", 'start': 1670.356, 'duration': 5.924}, {'end': 1685.665, 'text': "I'll pass in the password from the table, which is the hash password, and then I'll compare it against the password that is passed in the form here.", 'start': 1677.02, 'duration': 8.645}], 'summary': 'Modifying login route to use password hash for secure authentication.', 'duration': 30.578, 'max_score': 1655.087, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY1655087.jpg'}, {'end': 1789.947, 'src': 'embed', 'start': 1766.397, 'weight': 1, 'content': [{'end': 1777.988, 'text': 'So now I need to modify my user class to use the user mixin, which is what flask login uses to kind of inject some extra things into your user class.', 'start': 1766.397, 'duration': 11.591}, {'end': 1780.904, 'text': "So I'll add that there.", 'start': 1779.904, 'duration': 1}, {'end': 1784.306, 'text': "And then I'll also create the user loader.", 'start': 1782.065, 'duration': 2.241}, {'end': 1789.947, 'text': 'So there can be a connection between Flask login and the actual data in the database in a sense.', 'start': 1784.886, 'duration': 5.061}], 'summary': 'Modifying user class to use user mixin for flask login', 'duration': 23.55, 'max_score': 1766.397, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY1766397.jpg'}], 'start': 1536.261, 'title': 'Implementing password hashing and flask login', 'summary': 'Details the implementation of sha-256 hash method for password storage, integrating flask login module for user authentication, and access control, emphasizing app security and user authentication.', 'chapters': [{'end': 1591.965, 'start': 1536.261, 'title': 'Implementing password hashing for app security', 'summary': 'Details the implementation of password hashing for app security, including importing functions for generating and checking password hash, with a focus on integration into the registration and login views.', 'duration': 55.704, 'highlights': ['The chapter details the process of importing functions for generating and checking password hash from work search security.', 'The speaker explains the integration of generate password hash function in the registration view to create a hashed password from the user input.', 'The implementation of check password hash function in the login view is emphasized as a crucial step for verifying user passwords and ensuring app security.']}, {'end': 1822.802, 'start': 1593.306, 'title': 'Implementing password hashing and flask login', 'summary': 'Discusses implementing sha-256 hash method for password storage, replacing plain text passwords with hash passwords, and integrating flask login module for user authentication and access control.', 'duration': 229.496, 'highlights': ['The method used for password hashing is SHA-256, generating an 80-character hash, enhancing database security by storing hashed passwords instead of plain text, preventing exposure in case of a database breach.', 'Integration of Flask login involves importing and initializing necessary components such as login manager and user mixin, and modifying the user class to utilize user mixin and user loader, strengthening user authentication and access control.', 'The process of checking password hash involves comparing the hash password from the database with the password entered in the form, ensuring secure authentication and access to protected resources.']}], 'duration': 286.541, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY1536261.jpg', 'highlights': ['The method used for password hashing is SHA-256, generating an 80-character hash, enhancing database security by storing hashed passwords instead of plain text, preventing exposure in case of a database breach.', 'Integration of Flask login involves importing and initializing necessary components such as login manager and user mixin, and modifying the user class to utilize user mixin and user loader, strengthening user authentication and access control.', 'The process of checking password hash involves comparing the hash password from the database with the password entered in the form, ensuring secure authentication and access to protected resources.', 'The chapter details the process of importing functions for generating and checking password hash from work search security.', 'The speaker explains the integration of generate password hash function in the registration view to create a hashed password from the user input.', 'The implementation of check password hash function in the login view is emphasized as a crucial step for verifying user passwords and ensuring app security.']}, {'end': 2135.342, 'segs': [{'end': 1884.409, 'src': 'embed', 'start': 1854.695, 'weight': 2, 'content': [{'end': 1859.577, 'text': 'So I think hash test was the last one I used, and the password was hash hash.', 'start': 1854.695, 'duration': 4.882}, {'end': 1871.974, 'text': "And either it didn't work because I typed in the wrong password, so hash hash, or something's just not working correctly,", 'start': 1863.139, 'duration': 8.835}, {'end': 1874.056, 'text': "which I'll investigate in a moment.", 'start': 1871.974, 'duration': 2.082}, {'end': 1884.409, 'text': "But I definitely can't get to the dashboard without having logged in in the first place, which is exactly what I want.", 'start': 1875.458, 'duration': 8.951}], 'summary': 'Troubleshooting login issue with hash test and password hash hash.', 'duration': 29.714, 'max_score': 1854.695, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY1854695.jpg'}, {'end': 2098.801, 'src': 'embed', 'start': 2041.718, 'weight': 0, 'content': [{'end': 2046.525, 'text': 'if i click log out here, It sends me back to the home page.', 'start': 2041.718, 'duration': 4.807}, {'end': 2050.851, 'text': 'And if I try to go to the dashboard again, I have to log in once again.', 'start': 2046.605, 'duration': 4.246}, {'end': 2058.784, 'text': "And that's it.", 'start': 2050.871, 'duration': 7.913}, {'end': 2066.263, 'text': 'So now we have our app done and each one of the routes works.', 'start': 2061.681, 'duration': 4.582}, {'end': 2070.864, 'text': 'So I can log in, I can sign up, and then I can see the protected dashboard.', 'start': 2066.902, 'duration': 3.962}, {'end': 2076.525, 'text': "So as you can see, I had to use quite a few things, but still it's not that much code to get all this working.", 'start': 2071.643, 'duration': 4.882}, {'end': 2080.947, 'text': 'I had to use Flask Bootstrap, Flask WGF, SQL Alchemy.', 'start': 2077.025, 'duration': 3.922}, {'end': 2084.309, 'text': 'I had to use some security from WorkZerg and Flask Login.', 'start': 2081.228, 'duration': 3.081}, {'end': 2089.993, 'text': 'But once I had all those things, I was able to create this app pretty easily.', 'start': 2084.949, 'duration': 5.044}, {'end': 2098.801, 'text': 'And I think it works pretty well as a start to any app that you would want to build that has to have some kind of login system and protected pages.', 'start': 2090.494, 'duration': 8.307}], 'summary': 'App includes login, signup, protected dashboard. uses flask, sql alchemy, workzerg for security.', 'duration': 57.083, 'max_score': 2041.718, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY2041718.jpg'}], 'start': 1822.802, 'title': 'Python and flask login features', 'summary': 'Covers testing a python app login feature and implementing user login, logout, and protected page access in a flask application using various frameworks and tools, resulting in a functional login system and protected pages.', 'chapters': [{'end': 1884.409, 'start': 1822.802, 'title': 'Python app login testing', 'summary': 'Demonstrates testing a python app login feature, ensuring that the dashboard redirects to the sign-in screen and the user cannot access the dashboard without logging in first.', 'duration': 61.607, 'highlights': ['The app redirects to the sign-in screen when trying to access the dashboard without logging in, meeting the desired functionality.', "The user attempted to log in using 'hash test' as the username and 'hash hash' as the password, indicating the testing of specific login credentials.", 'Encountered an issue with the login process, possibly due to incorrect password input or underlying system malfunction, requiring further investigation.']}, {'end': 2135.342, 'start': 1886.211, 'title': 'Implementing user login and logout in flask', 'summary': 'Details the process of implementing user login, logout, and protected page access in a flask application, demonstrating the use of various frameworks and tools such as flask, flask bootstrap, flask wgf, sql alchemy, workzerg, and flask login, resulting in a functional login system and protected pages.', 'duration': 249.131, 'highlights': ['The chapter details the process of implementing user login, logout, and protected page access in a Flask application, demonstrating the use of various frameworks and tools such as Flask, Flask Bootstrap, Flask WGF, SQL Alchemy, WorkZerg, and Flask Login.', 'The author mentions the necessity of using Flask Bootstrap, Flask WGF, SQL Alchemy, and security frameworks like WorkZerg and Flask Login to create the app.', 'The author emphasizes that despite the use of various tools, the code required to implement the login system and protected pages is not extensive, indicating the ease of creating such functionality with the mentioned tools.', 'The author plans to share the code online and provide a link for it, along with the code for the beginning part, encouraging viewers to ask questions and leave comments for further clarification.']}], 'duration': 312.54, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/8aTnmsDMldY/pics/8aTnmsDMldY1822802.jpg', 'highlights': ['The app redirects to the sign-in screen when trying to access the dashboard without logging in, meeting the desired functionality.', 'The chapter details the process of implementing user login, logout, and protected page access in a Flask application, demonstrating the use of various frameworks and tools such as Flask, Flask Bootstrap, Flask WGF, SQL Alchemy, WorkZerg, and Flask Login.', "The user attempted to log in using 'hash test' as the username and 'hash hash' as the password, indicating the testing of specific login credentials.", 'The author mentions the necessity of using Flask Bootstrap, Flask WGF, SQL Alchemy, and security frameworks like WorkZerg and Flask Login to create the app.']}], 'highlights': ['The user login system utilizes Flask extensions including Flask Login, Flask SQL Alchemy, Flask WT Forms, and Flask Bootstrap.', 'The system includes functionalities such as signup, login, dashboard, and index page.', 'The process involves creating a user, entering an email, and setting a password for signup.', "The system redirects users to the dashboard upon logging in, displaying the user's name, and allows logging out to return to the index page.", 'The chapter involves creating web pages and a server, including a home page, login page, sign up page, and dashboard, with simple views.', 'The chapter emphasizes the use of Flask form over the form class when converting login and signup forms to Flask WTF.', 'The login form is created with three fields - username, password, and remember me, each with specific length and input requirements.', 'The username field has a minimum length of 4 and a maximum length of 15 characters, with input required validation.', 'The password field has a minimum length of 8 and a maximum length of 80 characters, with input required validation.', 'Creation of registration form with email, username, and password fields The speaker creates a registration form with email, username, and password fields, including validators for email and maximum email length.', "Creation of login form with remember me checkbox The speaker creates a login form with a 'Remember Me' checkbox as a Boolean field and integrates it into the form generation process.", 'The chapter covers initializing the form register, adding form fields for username, email, and password, and implementing form actions and methods.', 'The chapter demonstrates checking and submitting form data for login and registration forms in Flask, ensuring the forms work correctly and returning submitted data.', 'The user table is created with fields for ID, username, email, and password, setting username and email fields to be unique and with specific character limits, and the password field to be 80 characters long.', 'A SQLite database is created and a URI for it is defined, with the user table being created and defined to have fields for username, email, and password, with specific character limits and unique constraints.', 'The method used for password hashing is SHA-256, generating an 80-character hash, enhancing database security by storing hashed passwords instead of plain text, preventing exposure in case of a database breach.', 'Integration of Flask login involves importing and initializing necessary components such as login manager and user mixin, and modifying the user class to utilize user mixin and user loader, strengthening user authentication and access control.', 'The process of checking password hash involves comparing the hash password from the database with the password entered in the form, ensuring secure authentication and access to protected resources.', 'The app redirects to the sign-in screen when trying to access the dashboard without logging in, meeting the desired functionality.', 'The chapter details the process of implementing user login, logout, and protected page access in a Flask application, demonstrating the use of various frameworks and tools such as Flask, Flask Bootstrap, Flask WGF, SQL Alchemy, WorkZerg, and Flask Login.']}