I\'m trying to understand how Flask-Login works.
I see in their documentation that they use a pre-populated list of users. I want to play with a database-stored user
As per from the Flask-Login's document a user object must be returned and if the user id is not found it should return None instead of Exception.
@login_manager.user_loader
def load_user(userid):
try:
#: Flask Peewee used here to return the user object
return User.get(User.id==userid)
except User.DoesNotExist:
return None