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 details)

Uploaded Source

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

Hashes for django-top-notify-1.0.0.tar.gz
Algorithm Hash digest
SHA256 75c20321f123b37e3cecc6907564a4e2ba05cd8f7fb1ee731ba834f3c4a9f72b
MD5 bdb06b5bbfaa010372cf5ed16c5446ac
BLAKE2b-256 9c005d0b8275a0515027aac451762ca5c883a3a5eef823bd2d18e16a21f7cec0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page