Skip to main content

flash

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 :func:get_flashed_messages.

def flash(
message: str,
category: str = "message"
) - > None

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 :func:get_flashed_messages.

Parameters

NameTypeDescription
messagestrThe message content to be flashed and displayed to the user.
categorystr = "message"The category for the message used to group or style messages (e.g., 'error', 'info', 'warning').

Returns

TypeDescription
NoneNothing is returned; the message is stored in the session for the next request.