In this Flask video lesson we want to learn about Flask Flash Messages, Flask flash messages are a feature provided by Flask that allows you to easily display feedback messages to users. Flash messages are typically used to display success or error messages after a user performs an action on a website, such as submitting a form. in Flask flash messages are implemented using flash function provided by the flask module. when a flash function is called the message is stored in temporary session that is only available for the next request. get_flashed_messages function can then be used to retrieve the stored messages and display them to the user.
Flash messages are often used in combination with redirects. after processing a user request Flask application may redirect the user to another page or to the same page with additional parameters. Flash messages can be used to display feedback to the user about the result of their action.
For example if a user submits a form with invalid data Flask application may redirect the user back to the form page with a flash message indicating that the submitted data was invalid. flash message can be displayed using HTML templates and get_flashed_messages function provided by Flask.