In our previous recipe, we learned how to implement session-based authentication ourselves. Flask-Login is a popular extension that handles a lot of stuff for us in a very good way, saving us from reinventing the wheel all over again. It also does not bind us to any specific database or limit us to any specific fields/methods for authentication. It can also handle the Remember me feature, account recovery features, and so on.
We can modify the application created in the previous recipe to accommodate the changes to be done by the Flask-Login extension.
Before that, we have to install the extension itself:
$ pip install Flask-Login
To use Flask-Login, we have to first modify ...