
Django Celery
This gives you production-ready patterns for integrating Celery with Django, covering everything from initial setup to canvas workflows. It shows you how to structure tasks for idempotency and retries, configure workers and beat schedulers, and handle time limits gracefully. The examples are concrete, like exponential backoff with jitter for API sync tasks and crontab schedules for periodic jobs. What I appreciate is that it doesn't just show the happy path. It includes patterns for handling soft time limits, retry strategies for rate-limited APIs, and idempotent task design so tasks can safely run multiple times. If you're offloading email sends, PDF generation, or scheduled reports from your Django request cycle, this covers the patterns you actually need in production.
- skills.sh installs
- 5.6K
- GitHub stars
- 300.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add affaan-m/ecc --skill django-celery --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
pip install 'celery[redis]' django-celery-results django-celery-beat
celery.py — App Entrypoint
# config/celery.py
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.development')
app = Celery('myproject')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks() # Discovers tasks.py in each INSTALLED_APP
@app.task(bind=True, ignore_result=True)
def debug_task(self):
print(f'Request: {self.request!r}')
# config/__init__.py
from .celery import app as celery_app
__all__ = ('celery_app',)
Django Settings
Sponsors
Details
- Repository
- github.com/affaan-m/ecc
- Categories
- Testing & QA, DevOps & CI/CD, Python, Design & UI/UX
- First seen
- Jul 14, 2026
More from affaan-m/ecc
All 263- Dotnet Patterns5.6K
- Blueprint5.5K
- Ecc Guide5.5K
- Code Tour5.5K
- Nuxt4 Patterns5.5K
- Healthcare Phi Compliance5.5K
- Inventory Demand Planning5.5K
- Agentic Os5.5K
- Product Capability5.5K
- Security Bounty Hunter5.5K
- Ai First Engineering5.5K
- Prisma Patterns5.5K
- Continuous Agent Loop5.5K
- Continuous Learning5.5K
- Agent Eval5.5K
- Exa Search5.5K
- Agent Sort5.5K
- Product Lens5.5K
- Iterative Retrieval5.5K
- Skill Stocktake5.5K
- Benchmark5.5K
- Healthcare Emr Patterns5.5K
- Homelab Network Setup5.5K
- Ios Icon Gen5.5K