Web Forms With WTF! - Flask Fridays #5

Codemy.com February 12, 2021
Video Thumbnail
John Elder Logo

John Elder

@johnelderai

About

AI is taking over the world...let's get into it! OpenClaw, Claude Code, Manus, Perplexity, and whatever other weird AI stuff that comes along with a pinch of Python Programming thrown in from time to time. Check out my website JohnElder.AI and Codemy.com for more videos!

Video Description

In this video we'll start to use Web Forms for our Flask project with WTF (What the Forms!). Web forms with WTF are incredibly easy to use and come with all sorts of features that we need like form validation, CSRF token creation, and even reCAPTCHA. You can always build out web forms by hand, but using a 3rd party system like WTF just makes it so much easier! In this video we'll look at FlaskForm, StringField, SubmitField, and the DataRequired validator. Timecodes 0:00​ - Intro 1:36 - Pip Install flask-wtf 2:04 - Import WTF 4:37 - Create A Secret Key 6:11 - Create a Form Class 7:45 - Create name.html Webpage 8:24 - Create Route and Function For name.html 12:12 - Add Link to name.html in Navbar 12:47 - Add Form To name.html Webpage 16:14 - Add Bootstrap To Form 18:23 - Change Button Color 19:33 - List of WTF Fields and Validators 21:33 - Check out the WTF Documentation 22:02 - Conclusion