This covers the standard Celery integration patterns you'll actually use in a Django production app: worker setup, task decorators with retries and timeouts, Beat scheduling for cron jobs, and canvas primitives like chains and chords. The examples are solid on the boring but critical stuff like idempotent task design, exponential backoff config, and using `acks_late` to handle worker crashes. If you're adding background jobs to Django or debugging why your tasks are piling up in the queue, this gives you the configuration and patterns without having to piece together Stack Overflow answers. The testing section appears cut off but the core implementation patterns are all here.

skills.sh installs
1.7K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --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/everything-claude-code
Category
Python
First seen
Jun 3, 2026

More from affaan-m/everything-claude-code

All 256

Recommended

More Python
1mindrally avatarflask-pythonmindrally/skillsGuidelines for Flask Python development with best practices for blueprints, RESTful APIs, and application factories.1.6Kskills.sh installs
2vintasoftware avatardjango-celery-expertvintasoftware/django-ai-pluginsExpert Django Celery guidance for asynchronous task processing. Use when designing background tasks, configuring Celery workers, handling task retries and error1.2Kskills.sh installs
3microsoft avatarpython-appservice-deploymicrosoft/azure-skillsDeploy Python (Flask/Django/FastAPI) code to Azure App Service Linux. WHEN: "Flask App Service", "Django App Service", "FastAPI App Service", "deploy Python to 322.4Kskills.sh installs
4trailofbits avatarmodern-pythontrailofbits/skillsConfigures Python projects with modern tooling (uv, ruff, ty). Use when creating projects, writing standalone scripts, or migrating from pip/Poetry/mypy/black.9.3Kskills.sh installs
5jeffallan avatarpython-projeffallan/claude-skillsUse when building Python 3.11+ applications requiring type safety, async programming, or robust error handling. Generates type-annotated Python code, configures9.1Kskills.sh installs
6jeffallan avatarfastapi-expertjeffallan/claude-skillsUse when building high-performance async Python APIs with FastAPI and Pydantic V2. Invoke to create REST endpoints, define Pydantic models, implement authentica6.4Kskills.sh installs