A top notification bar based on Django project
Project description
django-top-notify
A top notification bar based on Django project.
Feature
- Integrate into an existing Django project easily.
- Support
hintandalerttype of top notification. - Publish and cancel top notification dynamically without deployment.
- Latest notification will automatically be displayed.
Demo
-
Publish or cancel
Use Django Admin page to configure:
-
Hint top notification
-
Alert top notification
Quick Start
- Install django-top-notify:
# bash pip install django-top-notify
- Add
django_top_notifyinto INSTALLED_APPS:# settings.py INSTALLED_APPS = [ ... "django_top_notify", ... ]
- Add urls into urlpatterns:
# urls.py urlpatterns = [ ... path("top_notify/", include("django_top_notify.urls")), ... ]
- Collect static files & migrate:
# bash python manage.py collectstatic python manage.py migrate django_top_notify
- Add frontend elements into template:
<!--templates/index.html--> {% load static %} <head> <link rel="stylesheet" href="{% static 'django_top_notify/css/notification-top-bar.css' %}"> </head> <body> <div class="notification-top-bar-container"><div class="notification-top-bar"><p></p></div></div> ... <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="{% static 'django_top_notify/js/notification-top-bar.js' %}"></script> <script> $(function () { const url = "{% url 'django_top_notify:latest_system_notification' %}"; get_latest_system_notification(url); }) </script> </body>
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
django-top-notify-1.0.0.tar.gz
(84.2 kB
view details)
File details
Details for the file django-top-notify-1.0.0.tar.gz.
File metadata
- Download URL: django-top-notify-1.0.0.tar.gz
- Upload date:
- Size: 84.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75c20321f123b37e3cecc6907564a4e2ba05cd8f7fb1ee731ba834f3c4a9f72b
|
|
| MD5 |
bdb06b5bbfaa010372cf5ed16c5446ac
|
|
| BLAKE2b-256 |
9c005d0b8275a0515027aac451762ca5c883a3a5eef823bd2d18e16a21f7cec0
|