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.

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

django-messages-display-0.2.1.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

django_messages_display-0.2.1-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

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