Skip to main content

A top notification bar based on Django project

Project description

django-top-notify

license Release Version

A top notification bar based on Django project.

Feature

  • Integrate into an existing Django project easily.
  • Support hint and alert 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:

    configuration.png

  • Hint top notification

    hint_top_notification.png

  • Alert top notification

    alert_top_notification.png

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


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)

Uploaded Source

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