A reusable Django app for monitoring and administering Django 6.0 Tasks API jobs.
Project description
django-taskly
A reusable Django app for monitoring and administering Django 6.0 Tasks API jobs.
django-taskly captures task results via signals, persists them as TaskSnapshot
records, and provides a real-time monitoring dashboard with statistics,
filtering, search, and per-task detail pages — all integrated into the Django
admin UI.
Screenshots
| Dashboard | Task List |
|---|---|
| Task Detail | Task Snapshot (Admin) |
|---|---|
Features
- Monitoring dashboard — live stats cards (total, successful, failed, slow), slow-tasks table, and recent-tasks table
- Manual & auto-refresh — one-click refresh button plus a configurable auto-refresh timer (set your own interval, runs until you stop it)
- Task list with filters — paginated, filterable by status, searchable by task name, with HTMX-powered partial updates
- Task detail view — full snapshot inspection including timing, attempts, error class, and traceback
- Django admin integration — browse and inspect snapshots directly from the admin site (read-only)
- Signal-based automatic capture — listens to
task_finishedand records results with zero boilerplate - Cleanup management command — prune excess snapshots with
taskly_cleanup, with--dry-runpreview - Configurable — control retention limits, slow-task thresholds, and the dashboard title via a single
TASKLYdict
Quick Start
1. Install
pip install django-taskly
2. Add to INSTALLED_APPS
INSTALLED_APPS = [
# ...
"django_taskly",
]
3. Include the URLs
# urls.py
from django.urls import include, path
urlpatterns = [
path("admin/", admin.site.urls),
path("taskly/", include("django_taskly.urls")),
]
4. Run migrations
python manage.py migrate
5. Configure the Django Tasks backend
django-taskly monitors tasks that run through the Django 6.0 Tasks API. Configure at least one backend in your project settings:
TASKS = {
"default": {
"BACKEND": "django.tasks.backends.immediate.ImmediateBackend",
}
}
Visit http://localhost:8000/taskly/ to open the monitoring dashboard.
Configuration
All settings live under a single TASKLY dict. Every key is optional — the
values shown below are the defaults:
TASKLY = {
# Set to False to disable signal-based task capture entirely.
"ENABLED": True,
# Tasks that take longer than this (seconds) are flagged as "slow".
"SLOW_TASK_SECONDS": 5,
# Maximum number of TaskSnapshot rows to retain in the database.
"MAX_SNAPSHOTS": 1000,
# Title displayed in the dashboard header.
"DASHBOARD_TITLE": "Django Taskly",
}
Settings reference
| Key | Type | Default | Description |
|---|---|---|---|
ENABLED |
bool |
True |
Enable or disable automatic task capture via signals |
SLOW_TASK_SECONDS |
int/float |
5 |
Duration threshold (seconds) above which a task is marked slow |
MAX_SNAPSHOTS |
int |
1000 |
Maximum number of TaskSnapshot rows kept in the database |
DASHBOARD_TITLE |
str |
"Django Taskly" |
Title shown in the monitoring dashboard |
Dashboard Pages
| URL | Name | Description |
|---|---|---|
/taskly/ |
dashboard |
Stats cards, slow tasks, recent tasks |
/taskly/tasks/ |
task_list |
Paginated, filterable, searchable snapshot list |
/taskly/tasks/<task_id>/ |
task_detail |
Full detail view for a single snapshot |
All pages are staff-only (@staff_member_required) and extend admin/base_site.html
for seamless integration with the Django admin.
Navigation buttons are provided on each page to move between the dashboard and the task list.
HTMX partials
These endpoints are used internally for live updates and can also be consumed by custom integrations:
| URL | Description |
|---|---|
/taskly/partials/dashboard-stats/ |
Stats cards only |
/taskly/partials/dashboard-content/ |
Full dashboard body (stats + tables) |
/taskly/partials/task-list/ |
Task table <tbody> rows |
Management Commands
taskly_cleanup
Removes the oldest TaskSnapshot rows that exceed the configured retention limit.
# Delete snapshots beyond the MAX_SNAPSHOTS setting (default: 1000).
python manage.py taskly_cleanup
# Override the retention limit for this run only.
python manage.py taskly_cleanup --max-snapshots 500
# Preview what would be deleted without touching the database.
python manage.py taskly_cleanup --dry-run
| Option | Description |
|---|---|
--max-snapshots N |
Retain at most N snapshots (overrides the setting for this run) |
--dry-run |
Print the count of snapshots that would be deleted, without deleting |
How It Works
-
Signal capture — When a Django 6.0 task finishes, Django emits a
task_finishedsignal. django-taskly'sAppConfig.ready()connects a handler that automatically snapshots the result. -
Collector —
TaskCollector.snapshot_from_result()reads theTaskResultfields (id, status, timing, errors) and persists them viaupdate_or_createon theTaskSnapshotmodel. -
Dashboard — Views query
TaskSnapshotusing the custom manager methods (.failed(),.slow(),.recent()) and render HTMX-enabled templates. -
Cleanup — The
taskly_cleanupcommand (orTaskCollector.cleanup()) deletes the oldest rows beyond the retention limit.
Requirements
- Python 3.11+
- Django 6.0+
No additional runtime dependencies. HTMX is loaded from a CDN by the built-in templates; no JavaScript build step is needed.
Development
git clone https://github.com/acandincer/django-taskly.git
cd django-taskly
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=django_taskly --cov-report=term-missing
# Lint and format
ruff check django_taskly/
ruff format django_taskly/
License
MIT. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_taskly-0.1.0.tar.gz.
File metadata
- Download URL: django_taskly-0.1.0.tar.gz
- Upload date:
- Size: 45.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f841747fe6768fde7473c1d32e1ceffd3f974e37020aa5262ec260fe150eaa2b
|
|
| MD5 |
fa13f36b16eee0bd5fe623ae83c4398b
|
|
| BLAKE2b-256 |
d2e596836ca53576cbb5410998102e75a14fb3acd0d121d0bac886e021b061da
|
Provenance
The following attestation bundles were made for django_taskly-0.1.0.tar.gz:
Publisher:
publish.yml on Reyretee/django-taskly
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_taskly-0.1.0.tar.gz -
Subject digest:
f841747fe6768fde7473c1d32e1ceffd3f974e37020aa5262ec260fe150eaa2b - Sigstore transparency entry: 1042956846
- Sigstore integration time:
-
Permalink:
Reyretee/django-taskly@70d1eecb4e29cffc4c4e23bbf39b889f5a164cc3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Reyretee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@70d1eecb4e29cffc4c4e23bbf39b889f5a164cc3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file django_taskly-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_taskly-0.1.0-py3-none-any.whl
- Upload date:
- Size: 34.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bfac65c79ebe724b4a7b13dc172b64749695c22e4d607571b9b962df25bea66
|
|
| MD5 |
92d4fbaa6284b756eaf679a31dc7e052
|
|
| BLAKE2b-256 |
f1a20ad5ad4d98d3e497bddc7a6e0beea3f47f90b8028cb985fa26bb0fc6b086
|
Provenance
The following attestation bundles were made for django_taskly-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Reyretee/django-taskly
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_taskly-0.1.0-py3-none-any.whl -
Subject digest:
0bfac65c79ebe724b4a7b13dc172b64749695c22e4d607571b9b962df25bea66 - Sigstore transparency entry: 1042956857
- Sigstore integration time:
-
Permalink:
Reyretee/django-taskly@70d1eecb4e29cffc4c4e23bbf39b889f5a164cc3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Reyretee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@70d1eecb4e29cffc4c4e23bbf39b889f5a164cc3 -
Trigger Event:
workflow_dispatch
-
Statement type: