Flask-Login
Flask-Login provides user session management for Flask. It handles the common
tasks of logging in, logging out, and remembering your users' sessions over
extended periods of time.
Flask-Login is not bound to any particular database system or permissions
model. The only requirement is that your user objects implement a few methods,
and that you provide a callback to the extension capable of loading users from
their ID.
Read the documentation at https://flask-login.readthedocs.io.
A Basic Example
Let's walk through setting up a basic application. Note that this is a very basic guide:
we will be taking shortcuts here that you should never take in a real application.
To begin we'll set up a Flask app and a LoginManager from Flask-Login.
import flask
import flask_login
app = flask.Flask(__name__)
app.secret_key = "super secret string" # Change this!
[Flask]: https://flask.palletsprojects.com