User Login with Flask_Login - Flask Fridays #22

Published: 13 August 2021
on channel: Codemy.com
57,655
912

In this video I'll show you how to set up user Login with Flask_Login and Python.

We'll start out adding a Username field to our Users Table. After we migrate the database, we'll update the web forms to handle username.

Then we'll install and set up Flask_login that will handle logging in, logging out, sessions, and all the good things.


We'll also create a user dashboard that will only appear if a user is logged in.


#flask #codemy #JohnElder

Timecodes

0:00​​ - Introduction
1:17 - pip install flask_login
2:50 - import flask_login to app
3:17 - Add UserMixin to User Model
3:48 - Add Username To Users Model
4:33 - Make DB Migration
5:03 - Add Username Field UserForm
5:32 - Add Username Field Add_User View
6:21 - Add Username Field To Web Form
7:12 - Add Username To Webpage
8:00 - Create Login.html Template
9:11 - Create Dashboard.html Template
9:46 - Create Login Route and View
10:36 - Create Dashboard Route and View
11:02 - Create LoginForm
12:10 - Add Login Link To Navbar
13:06 - Add Flask_login Configuration
13:57 - @login_manager.user_loader
15:03 - Make Dashboard @Login_required
15:42 - Validate Login Form
17:00 - Check Password Hash
18:51 - Show Flash Messages
19:54 - Test It Out!
20:33 - Create Logout Functionality
21:54 - Add Logout Link To Dashboard
22:26 - Conclusion


Watch video User Login with Flask_Login - Flask Fridays #22 online without registration, duration hours minute second in high quality. This video was added by user Codemy.com 13 August 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 57,655 once and liked it 912 people.