Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed A Social Network with Flask!
You have completed A Social Network with Flask!
Preview
We have a model, we have a form. It's time to build a view and template to let people sign up for our app.
New Terms
-
form.validate_on_submit()- When the form is submitted through POST, make sure the data is valid. - Macro - A custom, executable bit of templating.
-
form.hidden_tag()- Renders hidden fields inside of a hidden<div>.
More information about macros.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Let's write our register view and
0:00
explore what all we have available when we
use forms.
0:00
Okay, after all that work in forms, we
want to be able to render this one,
0:04
we want to send it to a template.
0:08
So let's go over here to our app.py and
0:09
we're going to import a couple of more
things.
0:13
It's gonna get kinda long so I'm gonna put
parentheses around this too cuz, you know,
0:15
we're gonna be importing a lot of stuff.
0:19
So we needed to bring in our
render_template cuz we know we're gonna
0:21
render a template.
0:24
Let's bring in flash cuz we're probably
gonna wanna send out some flash messages.
0:26
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up