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_CONFIGsupport. - No django-site-warning-server anymore.
v0.4.0
- 简化告警管理:移除邮件发送相关功能。
v0.4.1
- 修正:文档内容。
Release files for django-site-warnings 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_site_warnings-0.4.1.tar.gz | 16.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_site_warnings-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 37.2 kB
Release files / django_site_warnings-0.4.1.tar.gz
| Download URL | django_site_warnings-0.4.1.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb27e1780c496f0f7fcebc8885415f20bc48c762638a105caff45e035dc628ed
|
|
BLAKE2b-256 checksum How to use checksums |
e157fcc37e076f24e65c520d643beff670766eacc53a7b066a05e92dc33a99d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / django_site_warnings-0.4.1-py3-none-any.whl
| Download URL | django_site_warnings-0.4.1-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53fba96dcb7da9a1b0f59f633eef217e5b386260c5f14a2f3c817d4bcb11661c
|
|
BLAKE2b-256 checksum How to use checksums |
964875736bf523a22003dfd6dad52c1f2413f7e5433409f50db16f57ec09d21e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|