Issue
I am currently learning flask and I have heard about the concept called UserMixin can anybody please tell what does it mean and how it works.
Solution
UserMixin
is part of flask-login
package that implements user authentication functionality. In order for flask-login
to work, it expects your User
object to have certain pre-defined methods, like get_id()
, is_authenticated()
, etc (you can see what these are in the docs here). Technically you don't have to use the mixin and implement these methods yourself, but extending from mixin is a nice shortcut.
Answered By - dmitrybelyakov
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.