filmov
tv
User Login with Flask_Login - Flask Fridays #22

Показать описание
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
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
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
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
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
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
Комментарии