Skip to main content

Python Django License PyPI Build Status Coverage Status Downloads

Django-Celery-GrowthMonitor

A Django helper to monitor jobs running Celery tasks

Features

  • Utilities to track progress of Celery tasks via in-database jobs

  • Designed for jobs with user-uploaded files

Requirements

Installation

Using PyPI

  1. Run pip install django-celery-growthmonitor

Using the source code

  1. Make sure pandoc is installed

  2. Run ./pypi_packager.sh

  3. Run pip install dist/django_celery_growthmonitor-x.y.z-[...].wheel, where x.y.z must be replaced by the actual version number and [...] depends on your packaging configuration

Usage

('state', echoices.fields.make_echoicefield(default=celery_growthmonitor.models.AJob.EState.CREATED, echoices=celery_growthmonitor.models.AJob.EState, editable=False)),
('status', echoices.fields.make_echoicefield(default=celery_growthmonitor.models.AJob.EStatus.ACTIVE, echoices=celery_growthmonitor.models.AJob.EStatus, editable=False)),
from .celery import app

@app.task
def my_task(holder: JobHolder, *args):
    job = holder.get_job()
    if job.has_failed():
        # Just skip the whole if the previous task failed
        return holder.pre_serialization()
    # Some processing
    ...
    job.save()
    return holder.pre_serialization()

Helpers

Automatically set the job failed on task failure using custom base Task class

from celery_growthmonitor.models.task import JobFailedOnFailureTask

@app.task(base=JobFailedOnFailureTask, bind=True)
def my_task(self, holder: JobHolder):
    pass
Admin
from django.contrib import admin

from celery_growthmonitor.admin import AJobAdmin

@admin.register(MyJob)
class MyJobAdmin(AJobAdmin):
    fields = AJobAdmin.fields + ('my_extra_field',)
    readonly_fields = AJobAdmin.readonly_fields + ('my_extra_field',)

Metadata

Release files for django-celery-growthmonitor 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-celery-growthmonitor 1.1.0
File Size Uploaded
django-celery-growthmonitor-1.1.0.tar.gz 25.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-celery-growthmonitor 1.1.0
File Interpreter ABI Platform
django_celery_growthmonitor-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 50.9 kB

Release files / django-celery-growthmonitor-1.1.0.tar.gz

Download URL django-celery-growthmonitor-1.1.0.tar.gz
Size 25.1 kB
Tags Source
SHA-256 checksum
How to use checksums
794dc8bd909a916b851dd7ccdec70dc3cca60b22d35cb887e0f1b2ef1f04a91a
BLAKE2b-256 checksum
How to use checksums
e4bb6f816ea0583303e0905f089b90d241d9719beccd76fe3fad8817b1b25456
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

Release files / django_celery_growthmonitor-1.1.0-py3-none-any.whl

Download URL django_celery_growthmonitor-1.1.0-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af456207c2acf6e73024e0acac389c7e6ecda5cb19bb1ada2ba43f50484d69c5
BLAKE2b-256 checksum
How to use checksums
65d0890ffb325551b8bc778c8190b82a828e422dabb6cdf544e741ba28451774
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page