Skip to content
Marketplace

django-celery

by affaan-m

DjangoおよびCeleryを使用した非同期タスク処理。タスクキューイング、ワーカー管理、エラー処理、スケジューリング。Redis/RabbitMQ ブローカー統合。

Overview

SKILL.mdRead at ef648e0

Django + Celery 非同期タスク

Django でのバックグラウンドジョブと非同期処理。

使用時期

  • メール送信をバックグラウンドで実行
  • 重い処理をスケジュール
  • 定期的なタスクを実行(日報、クリーンアップ)
  • 外部API呼び出しをキューイング
  • 複雑なワークフローを調整

セットアップ

1. Celery インストール
pip install celery redis
2. タスク定義
from celery import shared_task

@shared_task
def send_email(recipient):
    # メール送信ロジック
    pass
3. ワーカー起動
celery -A myapp worker -l info

タスク

非同期実行
send_email.delay(recipient)  # すぐにキューに追加、非同期実行
スケジューリング
from celery.schedules import crontab

app.conf.beat_schedule = {
    'send-report-daily': {
        'task': 'app.tasks.send_report',
        'schedule': crontab(hour=9, minute=0),
    },
}

エラーハンドリング

  • [ ] リトライロジック実装
  • [ ] デッドレター処理
  • [ ] ロギング構成
  • [ ] モニタリング設定(Flower)

詳細については、ドキュメントを参照してください。

Files 1 file

Install it by hand

Deska runs this for you, for every agent you pick. To run it yourself in a terminal:

npx skills add affaan-m/ecc --skill django-celery

More from affaan-m

  • docker-patternsaffaan-mDocker and Docker Compose patterns for local development, container security, networking, volume strategies, and multi-service orchestration. Use when setting up containerized development environments or reviewing Docker configurations.4,800 installs on skills.sh0
  • security-reviewaffaan-mUse this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.4,800 installs on skills.sh0
  • backend-patternsaffaan-mBackend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes. Use when building or reviewing Node.js, Express, or Next.js API routes and their data access.4,700 installs on skills.sh0
  • frontend-patternsaffaan-mFrontend development patterns for React, Next.js, state management, performance optimization, and UI best practices. Use when building or reviewing React or Next.js components, state, or render performance.4,700 installs on skills.sh0
  • coding-standardsaffaan-mBaseline cross-project coding conventions for naming, readability, immutability, and code-quality review. Use detailed frontend or backend skills for framework-specific patterns. Use when reviewing code quality or naming with no framework-specific skill that applies.4,500 installs on skills.sh0
All skills by affaan-m