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.0.tar.gz
.
File metadata
- Download URL: django-messages-display-0.4.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6461eeaf0c696b2da91457030f0dd824f47b70a9574d1c133c454b02511f5ee |
|
MD5 | be5806085153ba44cb2aa04677d656b9 |
|
BLAKE2b-256 | db9d2c91d79f7ba9458338e284e641f2b2148fe7189fd1905332abbc4268e8ca |
File details
Details for the file django_messages_display-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: django_messages_display-0.4.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0131c902d26aeeadb3c7093a5367fd4d5c56184c5c8d2e401871961d754242f |
|
MD5 | 8212c76856b450b39b180234e4a4c5f4 |
|
BLAKE2b-256 | f856a08e3f8f1c636d176bd1f8f0fbda51e9c950fa272dda90323e8446fd3fc9 |