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, duration hours minute second in high quality that is uploaded to the channel Codemy.com 13 August 2021. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 57,655 times and liked it 912 visitors.