Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
There's no reason to do all of this work ourselves when projects like Flask-Login exist to do so much of it for us. Let's use the `UserMixin` mixin to add the necessary properties to our model so users can log in.
pip install flask-login
Update
Use from flask_login import UserMixin
instead of from flask.ext.login import UserMixin
.
Notes
Mixins are small classes that add some specific feature. Since they're not the final class that we want to extend, they go at the beginning of our inheritance chain.
The UserMixin docs.
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
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