Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_messages_display-0.4.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

django_messages_display-0.4.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file django_messages_display-0.4.2.tar.gz.

File metadata

File hashes

Hashes for django_messages_display-0.4.2.tar.gz
Algorithm Hash digest
SHA256 09997e3e015ab17404a98f2628edac5c13a1b43324229f5e2e4037723b471519
MD5 bf018edb8d9f2ca1570e774a4be6b153
BLAKE2b-256 d1fc18ef200ca332aa26fd3ef8e54e8de5a276a5cca077e279c46aeb4b2ee27b

See more details on using hashes here.

File details

Details for the file django_messages_display-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_messages_display-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 682dbf8208303fd14b24b411163ad75ef56e5e90a4d3d56b087b8b81fe74f1c9
MD5 b311c29f10d9dd1c1e88c462650cd077
BLAKE2b-256 6c3f052f73b8e68d7c1efd81e46c6ccc1061b2896573ca836c8e78a6bab24799

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page