Skip to content

ZhaoQi99/django-celery-beat-endpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Celery Beat Endpoint

Python version PyPI package PyPI download GitHub GitHub last commit (by committer)

A library that provides basic status and tasks endpoint for Django Celery Beat.

Inspired by vintasoftware/django-celerybeat-status

Requirements

Install

pip install django-celery-beat-endpoint
✨🍰✨

Or you can use pip install git+https://github.com/ZhaoQi99/django-celery-beat-endpoint.git install latest version.

Usage

Quick start

Just edit proj/celery.py, and replace Celery with AwareCelery

from django_celery_beat_endpoint.celery import AwareCelery
app = AwareCelery("proj")
# Or
from django_celery_beat_endpoint.celery import AwareCelery as Celery
app = Celery("proj")

Settings

You can easily configure lower case setting by referring Configuration and defaults.

Or you can use a CELERY_ prefix uppercase setting and loading configuration from the Django settings module.

  • beat_port / CELERY_BEAT_PORT - port for http server

    Default: 8005

  • http_server / CELERY_BEAT_HTTP_SERVER - HTTP server class

    Default: "django_celery_beat_endpoint.backends:HTTPServer"

API

  • /status
{
  "status": "OK"
}
  • /tasks
[
  {
    "name": "proj.tasks.add",
    "task": "",
    "args": "()",
    "last_run_at": "2024-06-18 20:00:00",
    "schedule": "<freq: 1.00 minute>",
    "kwargs": "{}",
    "is_due": true,
    "next_execution": "2024-06-18 20:00:10"
  }
]

Roadmap

  • Support more server backends, such as Tornado, Flask and FastAPI.

License

GNU General Public License v3.0

Author