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
Now that users can sign up, we should let them sign in. Our `login()` view will be pretty straightforward, as will the template.
flask.ext.login is now flask_login
New terms
-
login_user- Function to log a user in and set the appropriate cookie so they'll be considered authenticated by Flask-Login
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
We'll need to check the password though,
so that adds a new step.
0:00
Let's get to it.
0:00
All right.
So, we need to build a login view.
0:02
As you can probably guess, our login view
actually also needs to have a login form.
0:06
The nice thing is our login form isn't
gonna be all that crazy, and
0:12
it's going to be pretty much the stuff we
used in our registration form.
0:16
So, let's go ahead and make this real
quick.
0:19
Class LoginForm is a form, and it's going
to have two fields.
0:23
So, we're just gonna do email.
0:29
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