django-saladbar 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_saladbar-0.1.0/LICENSE +21 -0
- django_saladbar-0.1.0/MANIFEST.in +4 -0
- django_saladbar-0.1.0/PKG-INFO +146 -0
- django_saladbar-0.1.0/README.md +106 -0
- django_saladbar-0.1.0/pyproject.toml +55 -0
- django_saladbar-0.1.0/setup.cfg +4 -0
- django_saladbar-0.1.0/src/django_saladbar.egg-info/PKG-INFO +146 -0
- django_saladbar-0.1.0/src/django_saladbar.egg-info/SOURCES.txt +31 -0
- django_saladbar-0.1.0/src/django_saladbar.egg-info/dependency_links.txt +1 -0
- django_saladbar-0.1.0/src/django_saladbar.egg-info/requires.txt +9 -0
- django_saladbar-0.1.0/src/django_saladbar.egg-info/top_level.txt +1 -0
- django_saladbar-0.1.0/src/saladbar/__init__.py +1 -0
- django_saladbar-0.1.0/src/saladbar/admin.py +1 -0
- django_saladbar-0.1.0/src/saladbar/apps.py +7 -0
- django_saladbar-0.1.0/src/saladbar/conf.py +43 -0
- django_saladbar-0.1.0/src/saladbar/migrations/0001_initial.py +35 -0
- django_saladbar-0.1.0/src/saladbar/migrations/__init__.py +0 -0
- django_saladbar-0.1.0/src/saladbar/models.py +13 -0
- django_saladbar-0.1.0/src/saladbar/py.typed +0 -0
- django_saladbar-0.1.0/src/saladbar/static/saladbar/js/chart.min.js +14 -0
- django_saladbar-0.1.0/src/saladbar/templates/saladbar/base.html +36 -0
- django_saladbar-0.1.0/src/saladbar/templates/saladbar/dashboard.html +690 -0
- django_saladbar-0.1.0/src/saladbar/templates/saladbar/result_detail.html +139 -0
- django_saladbar-0.1.0/src/saladbar/templates/saladbar/result_list.html +168 -0
- django_saladbar-0.1.0/src/saladbar/templates/saladbar/task_detail.html +312 -0
- django_saladbar-0.1.0/src/saladbar/templates/saladbar/task_list.html +227 -0
- django_saladbar-0.1.0/src/saladbar/templatetags/__init__.py +0 -0
- django_saladbar-0.1.0/src/saladbar/templatetags/saladbar_tags.py +11 -0
- django_saladbar-0.1.0/src/saladbar/urls.py +18 -0
- django_saladbar-0.1.0/src/saladbar/views.py +857 -0
- django_saladbar-0.1.0/tests/test_conf.py +35 -0
- django_saladbar-0.1.0/tests/test_helpers.py +205 -0
- django_saladbar-0.1.0/tests/test_views.py +139 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Brian Artschwager
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: django-saladbar
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Celery task monitoring dashboard for Django
|
|
5
|
+
Author: Brian Artschwager
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/bartschwager/django-saladbar
|
|
8
|
+
Project-URL: Repository, https://github.com/bartschwager/django-saladbar
|
|
9
|
+
Project-URL: Changelog, https://github.com/bartschwager/django-saladbar/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Issues, https://github.com/bartschwager/django-saladbar/issues
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Web Environment
|
|
13
|
+
Classifier: Framework :: Django
|
|
14
|
+
Classifier: Framework :: Django :: 4.2
|
|
15
|
+
Classifier: Framework :: Django :: 5.0
|
|
16
|
+
Classifier: Framework :: Django :: 5.1
|
|
17
|
+
Classifier: Framework :: Django :: 5.2
|
|
18
|
+
Classifier: Framework :: Celery
|
|
19
|
+
Classifier: Intended Audience :: Developers
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
+
Classifier: Topic :: System :: Monitoring
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: Django>=4.2
|
|
32
|
+
Requires-Dist: celery>=5.0
|
|
33
|
+
Requires-Dist: redis>=4.0
|
|
34
|
+
Requires-Dist: django-celery-beat>=2.5
|
|
35
|
+
Requires-Dist: django-celery-results>=2.5
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: build; extra == "dev"
|
|
38
|
+
Requires-Dist: twine; extra == "dev"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# django-saladbar
|
|
42
|
+
|
|
43
|
+
A Celery task monitoring dashboard for Django. Drop-in UI for monitoring workers, periodic tasks, queue depth, error grouping, and more.
|
|
44
|
+
|
|
45
|
+
## Requirements
|
|
46
|
+
|
|
47
|
+
- Python 3.10+
|
|
48
|
+
- Django 4.2+
|
|
49
|
+
- Celery 5.0+ with Redis broker
|
|
50
|
+
- django-celery-beat
|
|
51
|
+
- django-celery-results
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install django-saladbar
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Add to `INSTALLED_APPS`:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
INSTALLED_APPS = [
|
|
63
|
+
# ...
|
|
64
|
+
"django_celery_results",
|
|
65
|
+
"django_celery_beat",
|
|
66
|
+
"saladbar",
|
|
67
|
+
]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Include the URL conf:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from django.urls import include, path
|
|
74
|
+
|
|
75
|
+
urlpatterns = [
|
|
76
|
+
# ...
|
|
77
|
+
path("saladbar/", include("saladbar.urls")),
|
|
78
|
+
]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Run migrations:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
python manage.py migrate
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
All settings are optional. Add to your Django `settings.py`:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
# Template that saladbar pages extend.
|
|
93
|
+
# Must provide blocks: title, css, content, script-footer.
|
|
94
|
+
# Default: "saladbar/base.html" (ships with the package — includes Bootstrap 5 + FontAwesome)
|
|
95
|
+
SALADBAR_BASE_TEMPLATE = "myapp/base.html"
|
|
96
|
+
|
|
97
|
+
# Dotted path to your Celery app instance.
|
|
98
|
+
# Default: auto-discovered via celery.current_app
|
|
99
|
+
SALADBAR_CELERY_APP = "myproject.celery.app"
|
|
100
|
+
|
|
101
|
+
# Queue names to check for depth on the dashboard.
|
|
102
|
+
# Default: ("celery", "default", "bulk")
|
|
103
|
+
SALADBAR_QUEUE_NAMES = ("celery", "default", "high-priority")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Permissions
|
|
107
|
+
|
|
108
|
+
Saladbar defines two permissions:
|
|
109
|
+
|
|
110
|
+
- `saladbar.can_view_saladbar` — required to access the dashboard and all read-only pages
|
|
111
|
+
- `saladbar.can_manage_saladbar` — required to run tasks, revoke tasks, and purge queues
|
|
112
|
+
|
|
113
|
+
Assign these to users or groups via the Django admin.
|
|
114
|
+
|
|
115
|
+
> **Security note:** Saladbar exposes Celery task metadata — task names, arguments, results, tracebacks, worker info, and Redis broker stats — to users with `can_view_saladbar`. Users with `can_manage_saladbar` can execute, revoke, and purge tasks. **Grant these permissions carefully.**
|
|
116
|
+
|
|
117
|
+
## Features
|
|
118
|
+
|
|
119
|
+
- Real-time worker status and pool utilization
|
|
120
|
+
- 24h/7d task volume charts
|
|
121
|
+
- Periodic task health tracking (on-schedule / missed / never-run)
|
|
122
|
+
- 24-hour schedule timeline visualization
|
|
123
|
+
- Queue depth and throughput monitoring
|
|
124
|
+
- Redis broker info (memory, clients, hit rate, evictions)
|
|
125
|
+
- In-flight task monitoring with long-running detection
|
|
126
|
+
- Error grouping by exception type
|
|
127
|
+
- Top tasks by volume with trend indicators
|
|
128
|
+
- Slowest tasks by average runtime
|
|
129
|
+
- Per-queue statistics
|
|
130
|
+
- Stale task detection
|
|
131
|
+
- Task execution history with runtime trend charts
|
|
132
|
+
- Manual task execution and revocation
|
|
133
|
+
- Queue purge
|
|
134
|
+
- Auto-refresh with countdown timer
|
|
135
|
+
|
|
136
|
+
## Development
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
git clone https://github.com/bartschwager/django-saladbar.git
|
|
140
|
+
cd django-saladbar
|
|
141
|
+
pip install -e ".[dev]"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
MIT
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# django-saladbar
|
|
2
|
+
|
|
3
|
+
A Celery task monitoring dashboard for Django. Drop-in UI for monitoring workers, periodic tasks, queue depth, error grouping, and more.
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Python 3.10+
|
|
8
|
+
- Django 4.2+
|
|
9
|
+
- Celery 5.0+ with Redis broker
|
|
10
|
+
- django-celery-beat
|
|
11
|
+
- django-celery-results
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install django-saladbar
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Add to `INSTALLED_APPS`:
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
INSTALLED_APPS = [
|
|
23
|
+
# ...
|
|
24
|
+
"django_celery_results",
|
|
25
|
+
"django_celery_beat",
|
|
26
|
+
"saladbar",
|
|
27
|
+
]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Include the URL conf:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from django.urls import include, path
|
|
34
|
+
|
|
35
|
+
urlpatterns = [
|
|
36
|
+
# ...
|
|
37
|
+
path("saladbar/", include("saladbar.urls")),
|
|
38
|
+
]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Run migrations:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python manage.py migrate
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Configuration
|
|
48
|
+
|
|
49
|
+
All settings are optional. Add to your Django `settings.py`:
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
# Template that saladbar pages extend.
|
|
53
|
+
# Must provide blocks: title, css, content, script-footer.
|
|
54
|
+
# Default: "saladbar/base.html" (ships with the package — includes Bootstrap 5 + FontAwesome)
|
|
55
|
+
SALADBAR_BASE_TEMPLATE = "myapp/base.html"
|
|
56
|
+
|
|
57
|
+
# Dotted path to your Celery app instance.
|
|
58
|
+
# Default: auto-discovered via celery.current_app
|
|
59
|
+
SALADBAR_CELERY_APP = "myproject.celery.app"
|
|
60
|
+
|
|
61
|
+
# Queue names to check for depth on the dashboard.
|
|
62
|
+
# Default: ("celery", "default", "bulk")
|
|
63
|
+
SALADBAR_QUEUE_NAMES = ("celery", "default", "high-priority")
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Permissions
|
|
67
|
+
|
|
68
|
+
Saladbar defines two permissions:
|
|
69
|
+
|
|
70
|
+
- `saladbar.can_view_saladbar` — required to access the dashboard and all read-only pages
|
|
71
|
+
- `saladbar.can_manage_saladbar` — required to run tasks, revoke tasks, and purge queues
|
|
72
|
+
|
|
73
|
+
Assign these to users or groups via the Django admin.
|
|
74
|
+
|
|
75
|
+
> **Security note:** Saladbar exposes Celery task metadata — task names, arguments, results, tracebacks, worker info, and Redis broker stats — to users with `can_view_saladbar`. Users with `can_manage_saladbar` can execute, revoke, and purge tasks. **Grant these permissions carefully.**
|
|
76
|
+
|
|
77
|
+
## Features
|
|
78
|
+
|
|
79
|
+
- Real-time worker status and pool utilization
|
|
80
|
+
- 24h/7d task volume charts
|
|
81
|
+
- Periodic task health tracking (on-schedule / missed / never-run)
|
|
82
|
+
- 24-hour schedule timeline visualization
|
|
83
|
+
- Queue depth and throughput monitoring
|
|
84
|
+
- Redis broker info (memory, clients, hit rate, evictions)
|
|
85
|
+
- In-flight task monitoring with long-running detection
|
|
86
|
+
- Error grouping by exception type
|
|
87
|
+
- Top tasks by volume with trend indicators
|
|
88
|
+
- Slowest tasks by average runtime
|
|
89
|
+
- Per-queue statistics
|
|
90
|
+
- Stale task detection
|
|
91
|
+
- Task execution history with runtime trend charts
|
|
92
|
+
- Manual task execution and revocation
|
|
93
|
+
- Queue purge
|
|
94
|
+
- Auto-refresh with countdown timer
|
|
95
|
+
|
|
96
|
+
## Development
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git clone https://github.com/bartschwager/django-saladbar.git
|
|
100
|
+
cd django-saladbar
|
|
101
|
+
pip install -e ".[dev]"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
MIT
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "django-saladbar"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A Celery task monitoring dashboard for Django"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Brian Artschwager" },
|
|
14
|
+
]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Environment :: Web Environment",
|
|
18
|
+
"Framework :: Django",
|
|
19
|
+
"Framework :: Django :: 4.2",
|
|
20
|
+
"Framework :: Django :: 5.0",
|
|
21
|
+
"Framework :: Django :: 5.1",
|
|
22
|
+
"Framework :: Django :: 5.2",
|
|
23
|
+
"Framework :: Celery",
|
|
24
|
+
"Intended Audience :: Developers",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
"Programming Language :: Python :: 3",
|
|
27
|
+
"Programming Language :: Python :: 3.10",
|
|
28
|
+
"Programming Language :: Python :: 3.11",
|
|
29
|
+
"Programming Language :: Python :: 3.12",
|
|
30
|
+
"Programming Language :: Python :: 3.13",
|
|
31
|
+
"Programming Language :: Python :: 3.14",
|
|
32
|
+
"Topic :: System :: Monitoring",
|
|
33
|
+
]
|
|
34
|
+
dependencies = [
|
|
35
|
+
"Django>=4.2",
|
|
36
|
+
"celery>=5.0",
|
|
37
|
+
"redis>=4.0",
|
|
38
|
+
"django-celery-beat>=2.5",
|
|
39
|
+
"django-celery-results>=2.5",
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
[project.optional-dependencies]
|
|
43
|
+
dev = [
|
|
44
|
+
"build",
|
|
45
|
+
"twine",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[project.urls]
|
|
49
|
+
Homepage = "https://github.com/bartschwager/django-saladbar"
|
|
50
|
+
Repository = "https://github.com/bartschwager/django-saladbar"
|
|
51
|
+
Changelog = "https://github.com/bartschwager/django-saladbar/blob/main/CHANGELOG.md"
|
|
52
|
+
Issues = "https://github.com/bartschwager/django-saladbar/issues"
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.packages.find]
|
|
55
|
+
where = ["src"]
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: django-saladbar
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Celery task monitoring dashboard for Django
|
|
5
|
+
Author: Brian Artschwager
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/bartschwager/django-saladbar
|
|
8
|
+
Project-URL: Repository, https://github.com/bartschwager/django-saladbar
|
|
9
|
+
Project-URL: Changelog, https://github.com/bartschwager/django-saladbar/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Issues, https://github.com/bartschwager/django-saladbar/issues
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Web Environment
|
|
13
|
+
Classifier: Framework :: Django
|
|
14
|
+
Classifier: Framework :: Django :: 4.2
|
|
15
|
+
Classifier: Framework :: Django :: 5.0
|
|
16
|
+
Classifier: Framework :: Django :: 5.1
|
|
17
|
+
Classifier: Framework :: Django :: 5.2
|
|
18
|
+
Classifier: Framework :: Celery
|
|
19
|
+
Classifier: Intended Audience :: Developers
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
27
|
+
Classifier: Topic :: System :: Monitoring
|
|
28
|
+
Requires-Python: >=3.10
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
License-File: LICENSE
|
|
31
|
+
Requires-Dist: Django>=4.2
|
|
32
|
+
Requires-Dist: celery>=5.0
|
|
33
|
+
Requires-Dist: redis>=4.0
|
|
34
|
+
Requires-Dist: django-celery-beat>=2.5
|
|
35
|
+
Requires-Dist: django-celery-results>=2.5
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: build; extra == "dev"
|
|
38
|
+
Requires-Dist: twine; extra == "dev"
|
|
39
|
+
Dynamic: license-file
|
|
40
|
+
|
|
41
|
+
# django-saladbar
|
|
42
|
+
|
|
43
|
+
A Celery task monitoring dashboard for Django. Drop-in UI for monitoring workers, periodic tasks, queue depth, error grouping, and more.
|
|
44
|
+
|
|
45
|
+
## Requirements
|
|
46
|
+
|
|
47
|
+
- Python 3.10+
|
|
48
|
+
- Django 4.2+
|
|
49
|
+
- Celery 5.0+ with Redis broker
|
|
50
|
+
- django-celery-beat
|
|
51
|
+
- django-celery-results
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
pip install django-saladbar
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Add to `INSTALLED_APPS`:
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
INSTALLED_APPS = [
|
|
63
|
+
# ...
|
|
64
|
+
"django_celery_results",
|
|
65
|
+
"django_celery_beat",
|
|
66
|
+
"saladbar",
|
|
67
|
+
]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Include the URL conf:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from django.urls import include, path
|
|
74
|
+
|
|
75
|
+
urlpatterns = [
|
|
76
|
+
# ...
|
|
77
|
+
path("saladbar/", include("saladbar.urls")),
|
|
78
|
+
]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Run migrations:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
python manage.py migrate
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
All settings are optional. Add to your Django `settings.py`:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
# Template that saladbar pages extend.
|
|
93
|
+
# Must provide blocks: title, css, content, script-footer.
|
|
94
|
+
# Default: "saladbar/base.html" (ships with the package — includes Bootstrap 5 + FontAwesome)
|
|
95
|
+
SALADBAR_BASE_TEMPLATE = "myapp/base.html"
|
|
96
|
+
|
|
97
|
+
# Dotted path to your Celery app instance.
|
|
98
|
+
# Default: auto-discovered via celery.current_app
|
|
99
|
+
SALADBAR_CELERY_APP = "myproject.celery.app"
|
|
100
|
+
|
|
101
|
+
# Queue names to check for depth on the dashboard.
|
|
102
|
+
# Default: ("celery", "default", "bulk")
|
|
103
|
+
SALADBAR_QUEUE_NAMES = ("celery", "default", "high-priority")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Permissions
|
|
107
|
+
|
|
108
|
+
Saladbar defines two permissions:
|
|
109
|
+
|
|
110
|
+
- `saladbar.can_view_saladbar` — required to access the dashboard and all read-only pages
|
|
111
|
+
- `saladbar.can_manage_saladbar` — required to run tasks, revoke tasks, and purge queues
|
|
112
|
+
|
|
113
|
+
Assign these to users or groups via the Django admin.
|
|
114
|
+
|
|
115
|
+
> **Security note:** Saladbar exposes Celery task metadata — task names, arguments, results, tracebacks, worker info, and Redis broker stats — to users with `can_view_saladbar`. Users with `can_manage_saladbar` can execute, revoke, and purge tasks. **Grant these permissions carefully.**
|
|
116
|
+
|
|
117
|
+
## Features
|
|
118
|
+
|
|
119
|
+
- Real-time worker status and pool utilization
|
|
120
|
+
- 24h/7d task volume charts
|
|
121
|
+
- Periodic task health tracking (on-schedule / missed / never-run)
|
|
122
|
+
- 24-hour schedule timeline visualization
|
|
123
|
+
- Queue depth and throughput monitoring
|
|
124
|
+
- Redis broker info (memory, clients, hit rate, evictions)
|
|
125
|
+
- In-flight task monitoring with long-running detection
|
|
126
|
+
- Error grouping by exception type
|
|
127
|
+
- Top tasks by volume with trend indicators
|
|
128
|
+
- Slowest tasks by average runtime
|
|
129
|
+
- Per-queue statistics
|
|
130
|
+
- Stale task detection
|
|
131
|
+
- Task execution history with runtime trend charts
|
|
132
|
+
- Manual task execution and revocation
|
|
133
|
+
- Queue purge
|
|
134
|
+
- Auto-refresh with countdown timer
|
|
135
|
+
|
|
136
|
+
## Development
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
git clone https://github.com/bartschwager/django-saladbar.git
|
|
140
|
+
cd django-saladbar
|
|
141
|
+
pip install -e ".[dev]"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## License
|
|
145
|
+
|
|
146
|
+
MIT
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
pyproject.toml
|
|
5
|
+
src/django_saladbar.egg-info/PKG-INFO
|
|
6
|
+
src/django_saladbar.egg-info/SOURCES.txt
|
|
7
|
+
src/django_saladbar.egg-info/dependency_links.txt
|
|
8
|
+
src/django_saladbar.egg-info/requires.txt
|
|
9
|
+
src/django_saladbar.egg-info/top_level.txt
|
|
10
|
+
src/saladbar/__init__.py
|
|
11
|
+
src/saladbar/admin.py
|
|
12
|
+
src/saladbar/apps.py
|
|
13
|
+
src/saladbar/conf.py
|
|
14
|
+
src/saladbar/models.py
|
|
15
|
+
src/saladbar/py.typed
|
|
16
|
+
src/saladbar/urls.py
|
|
17
|
+
src/saladbar/views.py
|
|
18
|
+
src/saladbar/migrations/0001_initial.py
|
|
19
|
+
src/saladbar/migrations/__init__.py
|
|
20
|
+
src/saladbar/static/saladbar/js/chart.min.js
|
|
21
|
+
src/saladbar/templates/saladbar/base.html
|
|
22
|
+
src/saladbar/templates/saladbar/dashboard.html
|
|
23
|
+
src/saladbar/templates/saladbar/result_detail.html
|
|
24
|
+
src/saladbar/templates/saladbar/result_list.html
|
|
25
|
+
src/saladbar/templates/saladbar/task_detail.html
|
|
26
|
+
src/saladbar/templates/saladbar/task_list.html
|
|
27
|
+
src/saladbar/templatetags/__init__.py
|
|
28
|
+
src/saladbar/templatetags/saladbar_tags.py
|
|
29
|
+
tests/test_conf.py
|
|
30
|
+
tests/test_helpers.py
|
|
31
|
+
tests/test_views.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
saladbar
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
default_app_config = "saladbar.apps.SaladbarConfig"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from django.contrib import admin # noqa: F401
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Saladbar configuration with sensible defaults.
|
|
3
|
+
|
|
4
|
+
Users can override these in their Django settings module:
|
|
5
|
+
|
|
6
|
+
SALADBAR_BASE_TEMPLATE = "myapp/base.html"
|
|
7
|
+
SALADBAR_CELERY_APP = "myproject.celery.app"
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from django.conf import settings
|
|
11
|
+
|
|
12
|
+
# Template that all saladbar pages extend. Must provide blocks:
|
|
13
|
+
# title, css, content, script-footer
|
|
14
|
+
DEFAULT_BASE_TEMPLATE = "saladbar/base.html"
|
|
15
|
+
|
|
16
|
+
# Dotted path to the Celery app instance, e.g. "myproject.celery.app".
|
|
17
|
+
# When None, saladbar discovers it automatically via celery._state.
|
|
18
|
+
DEFAULT_CELERY_APP = None
|
|
19
|
+
|
|
20
|
+
# Queue names to check for depth on the dashboard.
|
|
21
|
+
DEFAULT_QUEUE_NAMES = ("celery", "default", "bulk")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def get_base_template():
|
|
25
|
+
return getattr(settings, "SALADBAR_BASE_TEMPLATE", DEFAULT_BASE_TEMPLATE)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def get_celery_app():
|
|
29
|
+
app_path = getattr(settings, "SALADBAR_CELERY_APP", DEFAULT_CELERY_APP)
|
|
30
|
+
if app_path:
|
|
31
|
+
from importlib import import_module
|
|
32
|
+
|
|
33
|
+
module_path, attr = app_path.rsplit(".", 1)
|
|
34
|
+
return getattr(import_module(module_path), attr)
|
|
35
|
+
|
|
36
|
+
# Auto-discover: grab the current default Celery app
|
|
37
|
+
from celery import current_app
|
|
38
|
+
|
|
39
|
+
return current_app
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def get_queue_names():
|
|
43
|
+
return getattr(settings, "SALADBAR_QUEUE_NAMES", DEFAULT_QUEUE_NAMES)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Generated by Django 5.2.11 on 2026-04-01 19:43
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
initial = True
|
|
9
|
+
|
|
10
|
+
dependencies = []
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.CreateModel(
|
|
14
|
+
name="SaladBarPermissions",
|
|
15
|
+
fields=[
|
|
16
|
+
(
|
|
17
|
+
"id",
|
|
18
|
+
models.BigAutoField(
|
|
19
|
+
auto_created=True,
|
|
20
|
+
primary_key=True,
|
|
21
|
+
serialize=False,
|
|
22
|
+
verbose_name="ID",
|
|
23
|
+
),
|
|
24
|
+
),
|
|
25
|
+
],
|
|
26
|
+
options={
|
|
27
|
+
"permissions": [
|
|
28
|
+
("can_view_saladbar", "Can view Salad Bar dashboard"),
|
|
29
|
+
("can_manage_saladbar", "Can manage tasks and purge queues"),
|
|
30
|
+
],
|
|
31
|
+
"managed": False,
|
|
32
|
+
"default_permissions": (),
|
|
33
|
+
},
|
|
34
|
+
),
|
|
35
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from django.db import models
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class SaladBarPermissions(models.Model):
|
|
5
|
+
"""Unmanaged model solely for defining saladbar permissions."""
|
|
6
|
+
|
|
7
|
+
class Meta:
|
|
8
|
+
managed = False
|
|
9
|
+
default_permissions = ()
|
|
10
|
+
permissions = [
|
|
11
|
+
("can_view_saladbar", "Can view Salad Bar dashboard"),
|
|
12
|
+
("can_manage_saladbar", "Can manage tasks and purge queues"),
|
|
13
|
+
]
|
|
File without changes
|