django-celery
Django + Celery async task patterns — configuration, task design, beat scheduling, retries, canvas workflows, monitoring, and testing. Use when adding background jobs, scheduled tasks, or async processing to a Django app.
By affaan-m · 2,877 installs
npx skills add affaan-m/ecc --skill django-celery
Source repository · Upstream listing
Django + Celery Async Task Patterns
Production grade patterns for background task processing in Django using Celery with Redis or RabbitMQ.
When to Activate
Adding background jobs or async processing to a Django app
Implementing periodic/scheduled tasks
Offloading slow operations (email, PDF generation, API calls) from request cycle
Setting up Celery Beat for cron like scheduling
Debugging task failures, retries, or queue backlogs
Writing tests for Celery tasks
Project Setup
Installation
celery.py — App Entrypoint
Django Settings
Running Workers
Task Design Patterns
Basic Task
Retryable Task
Idempotent Task Pattern
Design tasks so they can safely run multiple times with the same inputs:
Task with Soft Time Limit
Calling Tasks
Beat Scheduling (Periodic Tasks)
Code Defined Schedule
Database Defined Schedule (via django celery beat)
Canvas: Chaining and Grouping Tasks
Error Handling and Dead Letter Queue
Testing Celery Tasks
Unit Testing (No Broker)
Integration Testing with CELERY TASK ALWAYS EAGER
Testing Retries
Monitoring
Anti Patterns
Production Checklist
Check Setting
Worker restarts on crash supervisord or systemd unit
CELERY TASK ACKS LATE = True Re queue tasks on worker crash
CELERY WORKER PREFETCH MULTIPLIER = 1 Fair distribution of long tasks
Separate queues per priority Q default,high priority,low priority
CELERY TASK SOFT TIME LIMIT set Graceful timeout before hard kill
Sentry integration Capture all task failure signals
Flower or other monitor Visibility into queue depths
Beat runs on single node only Prevents duplicate scheduled task execution
Related Skills
django patterns — ORM, service layer, and project structure
django tdd — Testing Django models, views, and services
python testing — pytest configuration and fixtures