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
hint
andalert
type 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_notify
into 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 hashes)