Applying flash messages
Flash messages are usually seen on validated forms rendering error messages for every text field with an invalid input value. Sometimes flash messages are headlines or important notifications printed in all caps on a web page.
Flask has a flash method that any view function can import to make flash messages. The following authentication process creates a flash message after validating the user credentials from the database:
@current_app.route('/login/add', methods=['GET', 'POST']) def add_login(): if request.method == 'POST': current_app.logger.info('add_login POST view executed') login = Login(username=request.form['username'], password=request.form['password'], user_type=int(request.form['user_type']) ) repo...