flask.flash

flask.flash(message, category='message')[source]

Flashes a message to the next request. In order to remove the flashed message from the session and to display it to the user, the template has to call get_flashed_messages().

Changed in version 0.3: category parameter added.

Parameters:
  • message – the message to be flashed.
  • category – the category for the message. The following values are recommended: 'message' for any kind of message, 'error' for errors, 'info' for information messages and 'warning' for warnings. However any kind of string can be used as category.