Delete Database Records With Flask - Flask Fridays #12

codemy(72)
Published in
#flask
Words
132
Reading
1 min
Listen
Play
5y

In this video I'll show you how to delete records from the database using Flask and SQLAlchemy.

We'll create the ability to delete a user record from the database from that "add user" page as well as from the individual user page itself.

Deleting records from a database (whether MySQL or SQLITE or whatever) is really easy. We just pass the ID number, use it to look up the record in the database, then just give it a db.session.delete(id) function. Then commit the change and redirect back to the web page.

✅ Watch The Flask Playlist
https://bit.ly/3ig2eJn

▶️ Get The Code
http://bit.ly/2L1jBl5

✅ Subscribe To My YouTube Channel:
http://bit.ly/2IGzvOR

▶️ See More At:
https://Codemy.com

✅ Join My Facebook Group:
http://bit.ly/2GFmOBz

▶️ Learn to Code at https://Codemy.com
Take $22 off with coupon code: youtube

✅ Buy a Codemy T-Shirt!
http://bit.ly/2VC9WUN

Delete Database Records With Flask - Flask Fridays #12 | Ecency