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.
The colors used for the notifications, meet the WCAG (2.1) AA contrast levels.
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>
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
Built Distribution
Close
Hashes for django-messages-display-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bd817c7cd82907116ba54b459371f8c737ee6be5bde4dea69844cd1f352b8e6 |
|
MD5 | 05b98ba4e0c3e470b2c094a850499d0f |
|
BLAKE2b-256 | 3f8d8199e5cd0d43360f950342f9c3cb8573ac69f91f8961d1543241a32a683f |
Close
Hashes for django_messages_display-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd46d4db448623b3580d7924c0a12799bf11ce535c79fe2bdc3d67a5162f1ce8 |
|
MD5 | abc8600c2fa9bd29de59a31cddcc4a96 |
|
BLAKE2b-256 | 7d27b30b1a4b2c8058063c604618a86892f9e8102b14306596d9212b782e3e5e |