Web Forms With WTF! - Flask Fridays #5

preview_player
Показать описание
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
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
Рекомендации по теме
Комментарии
Автор

▶️ Watch Entire Flask Friday Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:
▶️ Get The Code

Codemycom
Автор

finally after 5 videos someone that explains everything clearly!

imnotaburrito
Автор

2023: [Bug Fix] You need to add {{ form.csrf_token }} before or after this line {{ form.hidden_tag() }} on the name.html page. Else if form.validate_on_submit() == False

This is a great series of videos. Thanks!

tradingoptions
Автор

I'm a simple man. I see a new Codemy video, I like, watch, learn and practice. lol

rauldinho
Автор

Just started Flask at my job for a project, and your videos are clear and very instructives. Good job man.

francislachapelle
Автор

Amazing lecture sir... Please keep uploading new updated videos on flask. you sre the best mentor

mehboob_pythonist
Автор

I have no words to describe my gratitude for this series of videos. In addition to being extremely educational and educational, they are so realistic that I am applying them to an educational project that I am developing with a group of friends. Thank you very much for the great work. Greetings from Brazil.

pmatoss
Автор

What a series of the videos!
Thanks for that amount of work!
Very cool
Cheers

articulation
Автор

Hi, I LOVE your tutorials, they are 100% on point. I'll keep on studying them with pleasure. Just a note : at 7:02, you say DataRequired() is a function, it seems to be an instance of the DataRequired class. It's only a detail but before running the code without the (), and reading the traceback, I was a bit lost :).

UGLi
Автор

Great video, very good and quick explanation. Thanks!

lukagajinov
Автор

I like you are smile everytime when you saying WTF

nerminqulu
Автор

Great video, very good explanation. Thank you!

rchocano
Автор

it's a hard framework to learn. Soooo many methods and references in there. But thank you anyways for every detail.

BenMrMakinesiyim
Автор

As usual, clear and concise. Anyone know why I should use wtforms over typical html input tags with specified types (email, password, etc.) and properties (required, title, etc.)?

Darkev
Автор

I like before seeing your vids! Because i know it gonna be so good -:)

hiwab
Автор

This is one of those cases where youtube videos are more helpful documentation than the actual documentation. Dear oh dear.

expressionamidstcacophony
Автор

I looked at many Flask tutorials and yours is the only one that helped me find a solution to this simple form. Took me a few hours to fix some bugs though.

I was very confused with the attributes that we have to pass to the render_template "name=name" and "form=form". What exactly does this part do in the code?

likbezlik
Автор

in case of is there any one wondering how to change button text other than submit: just pass what you want into the SubmitField that you created in your class. for example: submit = SubmitField('sometext')

salmantas
Автор

Is there a tutorial for adding

1. Date time picker to the form?
2. Multi select dropdowns?

andrewsweeney
Автор

cant get bootstrap to reflect changes in name.html EX: {{ form.name.label( class = "form-label" ) }} doesnt change the look

stephontidd