Back to Browse

How to Use Databases With SQLAlchemy - Flask Fridays #8

106.1K views
Mar 5, 2021
25:35

In this video I'll show you how to use databases with Flask using SQLAlchemy! Using databases with flask is a little harder than with other web frameworks, but it doesn't have to be too bad if you use SQLAlchemy. I'll show you how in this video by setting up a SQLite database and creating a table, and then adding a form to the site that allows us to add data to the database. After we learn how to do this with SQLite, we'll learn about MySQL and Postgres. Timecodes 0:00​​ - Introduction 1:13 - Pip Install Flask-SQLAlchemy 1:56 - Import SQLalchemy To Our Flask App 2:55 - Set SQLAlchemy Database URI For SQLITE 4:20 - Initialize The Database 4:50 - Create Our Database Model 9:39 - Import Model From The Terminal 10:38 - Create UserForm 11:25 - Create Route And Add_User Function 12:20 - Create Add_User.html Page 13:24 - Add Link To Add_User.html on Navbar 14:22 - Set Form to UserForm in Add_User Function 15:00 - Validate Form On Submit 16:54 - Save Data To Database On Submit 18:50 - Query Database And Output Users To Webpage 21:37 - Style Form With Bootstrap 22:37 - Add Table For User Output 24:46 - Conclusion

Download

1 formats

Video Formats

360pmp457.2 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

How to Use Databases With SQLAlchemy - Flask Fridays #8 | NatokHD