affaan-m avatar

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-code

Installs 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
1pixijs avatarpixijs-html-sourcepixijs/pixijs-skillsUse this skill when rendering live HTML/DOM elements (or frozen snapshots of them) as PixiJS v8 textures via the EXPERIMENTAL HTML-in-Canvas browser APIs. Cover5.5Kskills.sh installs
2earthtojake avatarimplicit-cadearthtojake/text-to-cadCreate, edit, render, and snapshot browser-native implicit CAD `.implicit.js` and `.implicit.mjs` files using GLSL signed-distance fields, shader primitives, sm5.5Kskills.sh installs
3affaan-m avatarproduct-lensaffaan-m/eccUse this skill to validate the "why" before building, run product diagnostics, and pressure-test product direction before the request becomes an implementation 5.5Kskills.sh installs
4trailofbits avatarruzzytrailofbits/skillsRuzzy is a coverage-guided Ruby fuzzer by Trail of Bits. Use for fuzzing pure Ruby code and Ruby C extensions.5.5Kskills.sh installs
5affaan-m avatarangular-developeraffaan-m/eccGenerates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signal5.5Kskills.sh installs
6affaan-m avatarfinance-billing-opsaffaan-m/eccEvidence-first revenue, pricing, refunds, team-billing, and billing-model truth workflow for ECC. Use when the user wants a sales snapshot, pricing comparison, 5.4Kskills.sh installs