Display messages from django.contrib.messages as notifications in the browser.
Project description
django-messages-display
Display messages from django.contrib.messages as notifications in the browser.
Setup
Install package using pip
:
python -m pip install django-messages-display
Add it to the installed apps:
INSTALLED_APPS = [
...
"django_messages_display",
...
]
How to use
Include the package template in templates where notifications are needed. If site-wide notifications apply for the whole site, it is convenient to add it to the base template, if there is one.
{% include 'django_messages_display/django_messages_display.html' %}
Further, for the styling to apply, the CSS should be loaded:
{% load static %}
...
<head>
...
<link rel="stylesheet" href="{% static 'django_messages_display/django_messages_display.css' %}">
</head>
Accessibility
Notifications have the relevant attributes, so that the screen reader announces each one without interrupting the users' flow. Even though visually the notifications disappear after a certain amount of time, they remain in the document in order to be accessible by the screen reader on demand.
The colors used for the notifications, meet the WCAG (2.1) AA contrast levels.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_messages_display-0.4.3.tar.gz
.
File metadata
- Download URL: django_messages_display-0.4.3.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0d1962069c3f33d5684bbf558f47038fa6e5231ca51ee35739ce18a575849c6 |
|
MD5 | 55246e1c90de1b29f47e9e765cce80fd |
|
BLAKE2b-256 | 496b2e323504e62b3579ab1a7301b795032a735353b6c6a2358b996897ff05aa |
File details
Details for the file django_messages_display-0.4.3-py3-none-any.whl
.
File metadata
- Download URL: django_messages_display-0.4.3-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b52189fea2942ccb95cde96c6c86610202c8911c149a26f3d9274cca6fd06cd7 |
|
MD5 | 991eb747af5345941f6dec8285178c4e |
|
BLAKE2b-256 | 7b116842f90b94387e255e1f59c6e22fee595f2130acd242bd1e3bd8aae86b4a |