Python Flask Tutorial: Full-Featured Web App Part 3 - Forms and User Input

preview_player
Показать описание
In this Python Flask Tutorial, we will be learning how to create forms and accept user input. We will also learn how to validate that user input and notify the user if the input was invalid. Let's get started...

The code for this series can be found at:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:

#Python #Flask
Рекомендации по теме
Комментарии
Автор

2:03 - importing wtforms
2:15 - HTML forms vs Python for forms
2:34 - Registration form
2:39 - Creating first RegistrationForm (This inherits from FlaskForm)
2:48 - Having different form fields
2:55 - Adding a username field
3:00 - A username is a "StringField" (From wtforms)
3:40 - Including limitations for usernames (or other fields)
4:08 - Validators
4:19 - Validators are arguments you pass into your fields
4:25 - Passing a list of validators
4:36 - "DataRequired" validator
4:41 - "wtforms.validators"
5:03 - "Length" validator
5:51 - "Email" validator
6:33 - "Password" field
7:16 - Password confirmation
7:27 - "EqualTo" validator for password confirmation
8:00 - "EqualTo" arguments are the field you want this to be field to be equal to
8:12 - Submit button
8:20 - "Submit" field
8:50 - Creating a login form
9:35 - Adding a "remember" field, cookie, so browser remembers users
10:20 - Setting a secret key for your application
12:15 - Creating routes for registration and login forms
12:22 - Registration route
14:08 - Creating templates for registration & login form

cannon
Автор

Man, your videos are better than paid online courses. would be happy if you could prepare data science tutorials...

SaidKerimov
Автор

IF YOU HAVE A PROBLEM RUNNING IT AT 22:18 LIKE I DID, READ THIS!
I kept getting the message "Exception: Install 'email_validator' for email validation support." To fix this, just run "pip install email-validator" in your terminal. That should fix it.

girloffthecob
Автор

Around 48:00 when he is talking about using the multi-select functionality he never tells you how to do this. For those that didn't know it existed you select the first instance of the word you want to replace (double click the word to select it quickly) then use the key combination CTRL-D which will select the closest next instance of the same word you have selected. Keep hitting CTRL-D until you have all the ones you want to replace selected. Then you can just type in your change and all selected words will get what you type in.

acidspark
Автор

If you don't see the validation in the browser (for example if you don't see the "This field is required." message) then:

1. Make sure you included "novalidate" attribute on line 4 from register.html so should be <form method="POST" action="" novalidate>
2. Make sure you typed "for error" and not "for errors" as I did. Took me 20 minutes to realize but now the form validation works correctly.

BitRunner
Автор

36:04 If you're using PyCharm, Select all occurrences like:
1) *Set multiple cursors* in the editor area: *Alt + Mouse Click* (Option + Mouse Click for Mac OS X). ...


2) *Select/unselect* the next occurrence: *Alt + J/Shift + Alt +J* (Ctrl + G / Shift + Ctrl +G for Mac OS X)


3) *Select all* occurrences: *Shift + Ctrl + Alt + J* (Ctrl + Cmd + G for Mac OS X)

Hosseinsarpanah
Автор

Flask has changed so much since Corey released this 3 years ago. An update would be stellar!

The_Bri_Cli
Автор

This is easily one of the best video courses I have ever seen. The content is well paced, clean and the chapters progress nicely.

joeg
Автор

I love how you are showing how to include bootstrap classes into the form. I also like how you showed how to customize the errors. Looking forward to completing this flask series.

enduringpromise
Автор

I'm learning data science and found your post in Youtube for basic Python.. now I'm going through all of them... it's like watching a new English TV series.. don't have control to stop watching the next one.. All the best..

upendraroul
Автор

Thanks Corey. I've been through many tutor channels, and I must say yours is one of the best, if not the best. I especially like your speed - no "uuhhh" or "ummm" or speed humps. To the point and very good. You know your stuff!

Quicksilver
Автор

I have been up hill and down dale searching resources to get me started with Python/Flask/Web. I just want to say thank you, because what you are presenting here is the best I have found.

iansjackson
Автор

Clear voice, easy explanation, and great content ... keep going, man!

husseinsaad
Автор

Love your accent, sounds like a soft southern accent. Your content is fantastic.

lardosian
Автор

Man, that little trick you did where you added extra cursors to every instance of "dir" that should've been "div" and edited them all at once...so elegant. Love the videos!

treaper
Автор

He explained everything in this course so well, so nicely & clearly. Really worth giving time to this playlist and learning so many stuffs in a simple procedure

rishavtiwari
Автор

Was glad to see you make it onto the Talk Python podcast Corey. Your courses and material truly are very well done. Time to start launching some paid courses. When you do, I request Python with qt5. I will throw my money at a course with real life well done GUI applications. Especially if you are making it! Keep up the good work bud.

mattwilliams
Автор

You've done it again. I'm super excited to start building my own professional website now! Thanks Corey!

porlando
Автор

Fantastic tutorial. Had been reading articles all day, but nothing clicked until I found this series.

jdratlif
Автор

Just started this series a few days ago and I wanted to say thank you so much for all your effort in making these videos! Thyere very helpful to a beginner to flask like me :)

daisygirl