AGENT SKILL

python-frameworks

Use when building, reviewing, or choosing Python web or task frameworks, and the task calls for Django, FastAPI, or Celery patterns.

License 许可
MIT
最近更新
2026-10-08
Stars
★ 0
Forks
0

01 前言 Front Matter

name
python-frameworks
license
MIT
metadata
{ "owner": "Harley Bartles", "status": "active", "use_when": [ "building or reviewing Django applications.", "designing FastAPI services.", "adding Celery task queues.", "choosing between Django, FastAPI, and Celery for a component." ], "source-id": "python-frameworks", "source-path": "skills/python-frameworks/SKILL.md", "related_skills": [ "python", "typescript", "database-engines" ], "do_not_use_when": [ "the question is about pure Python language patterns (see python).", "another framework-specific skill owns the task." ], "provenance-name": "Python Frameworks first-party skill", "source-category": "first_party" }
description
Use when building, reviewing, or choosing Python web or task frameworks, and the task calls for Django, FastAPI, or Celery patterns.

02 资源文件 5

03 SKILL.md 正文

Python Frameworks

Use this skill when choosing or applying Python web and task-queue frameworks.

When to Use

  • Building or reviewing Django applications.
  • Designing FastAPI APIs and services.
  • Adding Celery background tasks or scheduled jobs.
  • Choosing among Django, FastAPI, and Celery for a component.

Core Pattern

  1. Choose Django for full-stack server-rendered or admin-heavy applications that need an ORM, migrations, and batteries-included conventions.
  2. Choose FastAPI for API-first services that benefit from async endpoints, automatic OpenAPI docs, and Pydantic validation.
  3. Use Celery to offload work to background workers when the response path must stay fast; broker with Redis or RabbitMQ and use result backends only when callers need results.
  4. Keep framework code decoupled from business rules; put domain logic in services, models, or repositories and call it from views or tasks.
  5. Test at the framework boundary with the FastAPI TestClient or Django test client; unit-test domain logic without loading the framework.

Common Mistakes

  • Putting business logic directly in views or tasks. → Move it to services or domain modules.
  • Using Celery for synchronous, latency-sensitive work. → Keep real-time work in the request path or use async APIs.
  • Mixing sync and async ORM calls in FastAPI. → Use async engines and sessions or route sync calls through executors.
  • Ignoring Django migrations in tests. → Run migrations and use fixtures that reflect schema state.

Load references/operational-guidance.md for deeper Django, FastAPI, and Celery patterns.

04 同仓库更多 Skills