Metadata-Version: 2.4
Name: django-celeryx
Version: 0.1.0a2
Summary: Celery monitoring and management for Django admin
Project-URL: Homepage, https://github.com/oliverhaas/django-celeryx
Project-URL: Documentation, https://oliverhaas.github.io/django-celeryx/
Project-URL: Repository, https://github.com/oliverhaas/django-celeryx.git
Project-URL: Changelog, https://oliverhaas.github.io/django-celeryx/reference/changelog/
Author-email: Oliver Haas <ohaas@e1plus.de>
License: MIT
License-File: LICENSE
Keywords: admin,celery,django,flower,monitoring
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Monitoring
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: django<7,>=5.2
Provides-Extra: celery
Requires-Dist: celery<6,>=5.4; extra == 'celery'
Provides-Extra: celery-asyncio
Requires-Dist: celery-asyncio>=6.0.0a1; extra == 'celery-asyncio'
Provides-Extra: prometheus
Requires-Dist: prometheus-client>=0.20.0; extra == 'prometheus'
Provides-Extra: unfold
Requires-Dist: django-unfold>=0.70.0; extra == 'unfold'
Description-Content-Type: text/markdown

# django-celeryx

[![PyPI version](https://img.shields.io/pypi/v/django-celeryx.svg?style=flat)](https://pypi.org/project/django-celeryx/)
[![Python versions](https://img.shields.io/pypi/pyversions/django-celeryx.svg)](https://pypi.org/project/django-celeryx/)
[![CI](https://github.com/oliverhaas/django-celeryx/actions/workflows/ci.yml/badge.svg)](https://github.com/oliverhaas/django-celeryx/actions/workflows/ci.yml)

Celery monitoring and management for Django admin. Like Flower, but embedded in your Django admin with htmx for real-time updates.

## Installation

```console
pip install django-celeryx[celery]
```

Or with celery-asyncio:

```console
pip install django-celeryx[celery-asyncio]
```

## Quick Start

```python
INSTALLED_APPS = [
    # ...
    "django_celeryx.admin",
]
```

That's it. Start your Django server and navigate to the admin to see your Celery tasks and workers.

## Features

- **Real-time task monitoring** — Live task list with state, args, result, timing, auto-refreshing via htmx
- **Worker management** — View worker status, pool info, active queues, configuration
- **Control actions** — Revoke/terminate tasks, shutdown/restart workers, manage pools and queues
- **Broker overview** — Queue names, routing keys, consumer counts
- **Django admin native** — Looks and feels like standard Django admin, no separate service to run
- **Database persistence** — All state persisted to database (dedicated SQLite file by default, or any Django database)
- **Registered tasks** — Browse all registered task types, link to filtered task list

## Task Monitoring

The task list shows all Celery tasks with color-coded states:

- **PENDING** (grey), **RECEIVED** (yellow), **STARTED** (blue), **SUCCESS** (green), **FAILURE** (red), **RETRY** (orange), **REVOKED** (purple)

Configurable columns via `TASK_COLUMNS` setting.

## Worker Management

Worker detail view with tabbed interface (matching Flower):

- **Pool** — Pool type, concurrency, processes. Controls: grow/shrink, autoscale
- **Queues** — Active queues. Controls: add/cancel consumer
- **Tasks** — Processed counts, active/scheduled/reserved/revoked tasks
- **Limits** — Rate limits and timeouts
- **Config** — Full worker Celery configuration
- **Stats** — System resource usage, broker connection info

## Control Actions

Full control parity with Flower:

- Revoke / terminate / abort tasks
- Shutdown / restart worker pool
- Grow / shrink pool, set autoscale
- Add / cancel queue consumer
- Set rate limits and time limits

## Configuration

```python
CELERYX = {
    "MAX_TASK_COUNT": 100_000,
    "MAX_TASK_AGE": 86400,  # 24 hours
    "AUTO_REFRESH_INTERVAL": 3,
    "TASK_COLUMNS": ["name", "uuid", "state", "worker", "received", "started", "runtime"],
}
```

## Unfold Theme

For [django-unfold](https://github.com/unfoldadmin/django-unfold) users:

```python
INSTALLED_APPS = [
    "unfold",
    # ...
    "django_celeryx.unfold",  # instead of django_celeryx.admin
]
```

## Documentation

Full documentation at [oliverhaas.github.io/django-celeryx](https://oliverhaas.github.io/django-celeryx/)

## Requirements

- Python 3.12+
- Django 5.2+
- Celery 5.4+ or celery-asyncio 6.0+

## License

MIT
