The UserMixin From Flask-Login5:50 with Kenneth Love
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
from flask_login import UserMixin instead of
from flask.ext.login import UserMixin.
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.
You need to sign up for Treehouse in order to download course files.Sign up