July 2018
Intermediate to advanced
324 pages
8h 14m
English
In order to develop an authentication module, we are going to use the Flask-Login extension. The Flask-Login extension provides a user session management mechanism. It handles the common tasks for managing user sessions such as logging in, logging out, and remembering the user.
To integrate Flask-Login, you need to create the instance and define some default parameters, as described in the following code snippet:
from flask_login import LoginManagerapp = Flask(__name__)login_manager = LoginManager()login_manager.session_protection = 'strong'login_manager.login_view = 'auth.login'login_manager.login_message_category = "info"login_manager.init_app(app)
We are going to create an authentication module as an auth package. An
Read now
Unlock full access