A minimal Django project wired to Celery and django_taskpulse, with demo
tasks that succeed (add), run slowly (slow_report), fail
(always_fails) and retry twice before succeeding (flaky_fetch).
From this directory, with the package installed (pip install -e "..[dev]"):
python manage.py migrate
python manage.py createsuperuser
python manage.py demo_seed
python manage.py runserver
demo_seed runs every demo task inline and records ~10 task runs. Browse
them at http://127.0.0.1:8000/admin/django_taskpulse/taskrun/ and open the
Stats button for aggregates.
Point CELERY_BROKER_URL at a broker (defaults to redis://localhost:6379/0)
and start a worker from this directory:
celery -A config worker -l info --pool=solo
Then queue tasks from python manage.py shell:
from demo.tasks import add, always_fails, flaky_fetch, slow_report
add.delay(2, 3)
always_fails.delay()
flaky_fetch.delay()
slow_report.delay(1.5)