add_message
Attempt to add a message to the request using the 'messages' app.
def add_message(
request: HttpRequest,
level: int,
message: str,
extra_tags: str = "",
fail_silently: bool = False
) - > None|Any
Attempt to add a message to the request using the 'messages' app.
Parameters
| Name | Type | Description |
|---|---|---|
| request | HttpRequest | The HttpRequest object to which the message will be attached. |
| level | int | An integer representing the message level (e.g., DEBUG, INFO, SUCCESS, WARNING, ERROR). |
| message | str | The actual content of the message to be displayed to the user. |
| extra_tags | str = "" | A string containing extra custom CSS classes or identifiers to apply to the message. |
| fail_silently | bool = False | If True, suppresses the MessageFailure exception when the messages middleware is not configured. |
Returns
| Type | Description |
|---|---|
| `None | Any` |