Skip to main content

记录站点告警信息,提供告警确认等管理功能。

Project description

django-site-warnings

Django application allow to create site warnings, make subscription, and receive notifies.

Install

pip install django-site-warnings

Usage

pro/views.py

from django_site_warnings.models import WaringCategory
from django_site_warnings.models import Warning

def background_sync_work(request):
    try:
        pass # do your own work
    except Exception as error:
        category = WaringCategory.get("warning category code")
        Warning.make(category, f"background_sync_work failed: {error}")

pro/settings

INSTALLED_APPS = [
    '...',
    'django_site_warnings',
    '...',
]

pro/menus.py

from django_site_warnings.global_sidebar import django_site_warnings_menu_item_of_applist

def site_menu(request=None):
    return [
        {
            "title": _("Home"),
            "icon": "fa fa-home",
            "url": "/admin/",
        },
        {
            "title": _("System Settings"),
            "icon": "fas fa-cogs",
            "children": [
                {
                    "title": _("User Manage"),
                    "icon": "fas fa-user",
                    "model": "auth.user",
                    "permissions": ["auth.view_user"],
                },
                {
                    "title": _("Group Manage"),
                    "icon": "fas fa-users",
                    "model": "auth.group",
                    "permissions": ["auth.view_group"],
                },
                django_site_warnings_menu_item_of_applist,
            ]
        }
    ]

Releases

v0.1.2

  • First release.

v0.1.4

  • Make title length longer.

v0.1.6

  • Test for Django 3.2.
  • Work with django-simpletask2.

v0.2.0

  • Add django_site_warnings.global_sidebar.django_site_warnings_menu_item_of_warning, django_site_warnings.global_sidebar.django_site_warnigns_menu_item_of_category and django_site_warnings.global_sidebar.django_site_warnings_menu_item_of_applist to work with django-admin-global-sidebar.
  • WaringCategory.get will auto create category instance if it is missing.
  • Register sendmail_notify to Warning by default.

v0.2.1

  • Show notify send result.

v0.2.2

  • Doc update.

v0.3.7

  • Add DJANGO_SITE_WARNING_NOTIFY_MAIL_CONFIG support.
  • No django-site-warning-server anymore.

v0.4.0

  • 简化告警管理:移除邮件发送相关功能。

v0.4.1

  • 修正:文档内容。

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_site_warnings-0.4.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_site_warnings-0.4.1-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file django_site_warnings-0.4.1.tar.gz.

File metadata

  • Download URL: django_site_warnings-0.4.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for django_site_warnings-0.4.1.tar.gz
Algorithm Hash digest
SHA256 eb27e1780c496f0f7fcebc8885415f20bc48c762638a105caff45e035dc628ed
MD5 37aeeb1a87af475604f8016bb3bc8bb6
BLAKE2b-256 e157fcc37e076f24e65c520d643beff670766eacc53a7b066a05e92dc33a99d2

See more details on using hashes here.

File details

Details for the file django_site_warnings-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_site_warnings-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53fba96dcb7da9a1b0f59f633eef217e5b386260c5f14a2f3c817d4bcb11661c
MD5 1787d7c7e714b4c058ba88251a87af40
BLAKE2b-256 964875736bf523a22003dfd6dad52c1f2413f7e5433409f50db16f57ec09d21e

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