Metadata-Version: 2.4
Name: django-periodic-tasks
Version: 0.1.0a3
Summary: Periodic/cron task scheduling for django-tasks. Backend-agnostic replacement for celery-beat.
Project-URL: Homepage, https://gitlab.com/thelabnyc/django-periodic-tasks
Project-URL: Repository, https://gitlab.com/thelabnyc/django-periodic-tasks
Author-email: thelab <thelabdev@thelab.co>
License: ISC
License-File: LICENSE
Requires-Python: >=3.13
Requires-Dist: croniter>=1.0
Requires-Dist: django-tasks>=0.7
Requires-Dist: django>=5.2
Provides-Extra: rq
Requires-Dist: django-rq; extra == 'rq'
Requires-Dist: django-tasks[rq]; extra == 'rq'
Description-Content-Type: text/markdown

# django-periodic-tasks

Periodic/cron task scheduling for [django-tasks](https://github.com/RealOrangeOne/django-tasks). Backend-agnostic replacement for celery-beat + django-celery-beat.

## Installation

```bash
pip install django-periodic-tasks
```

Add to `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
    ...
    "django_periodic_tasks",
]
```

## Usage

### Define scheduled tasks

```python
from django_tasks import task
from django_periodic_tasks import scheduled_task

@scheduled_task(cron="0 5 * * *", name="daily-report")
@task()
def daily_report() -> None:
    ...
```

### Run the scheduler

Enable the autostart setting so the scheduler runs as a daemon thread inside your Django process:

```python
# settings.py
PERIODIC_TASKS_AUTOSTART = True
```

Or run it as a standalone process:

```bash
python manage.py run_scheduler
```
