django-python — Claude Code skill: Django rules for your agent
A skill that steers your agent through Django work: MVT structure, ORM over raw SQL, class-based views and view-level error handling.
npx skills add Mindrally/skills --skill django-python -a claude-codeWhat django-python does
This skill turns the assistant into a Django pair programmer. It asks for answers backed by concrete code, PEP 8 compliance and descriptive lowercase names with underscores. Projects should be split into separate Django apps.
The rules cover each layer. Complex logic goes into class-based views, simple tasks stay as functions. Database work runs through the ORM, with raw SQL kept as a last resort. Forms and models get validated by the built-in framework, errors are caught at the view level, and 404 or 500 pages can be customised. Signals handle cases where error handling needs to stay decoupled.
A separate section deals with performance: select_related() and prefetch_related(), indexing, caching through Redis or Memcached, Celery for I/O-bound work, static files via WhiteNoise or CDN. The skill also names the stack it assumes: Django REST Framework, Celery, Redis, PostgreSQL or MySQL. If your project uses none of those, some advice will miss the mark — worth checking what is actually in your dependencies.
What it helps with
- split a project into separate Django apps
- choose between class-based and function-based views
- replace raw SQL queries with the ORM
- wire up form and model validation
- speed up queries with
select_related()andprefetch_related()
Example prompts for the agent
- Write a class-based view for a paginated order list and show the template
- Rewrite this query using the ORM instead of raw SQL
- Add validation to the signup form and handle errors at the view level
How to install django-python
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill django-python -a claude-code2Manually: put the files in place
~/.claude/skills/django-python/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/django-python/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill django-python -a codex2Manually: put the files in place
.agents/skills/django-python/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill django-python -a cursor2Manually: put the files in place
.cursor/skills/django-python/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills django-python2Manually: put the files in place
.github/skills/django-python/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill django-python -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path django-pythonManually: put the files in place
.devin/skills/django-python/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill django-python -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about django-python
How do I install django-python in Claude?
Run npx skills add Mindrally/skills --skill django-python -a claude-code. The skill file then lives at ~/.claude/skills/django-python/SKILL.md.
What does django-python do?
It gives the agent Django conventions: MVT, the ORM, built-in authentication, form validation, view-level error handling and query optimisation.
Which dependencies does the skill assume?
It is written around Django REST Framework, Celery, Redis and PostgreSQL or MySQL. Caching and queues run on Redis or Memcached.
Source text
SKILL.md · Apache-2.0
--- name: django-python description: Expert in Django Python web development with best practices metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Django Python You are an expert in Django and Python web development. ## Core Principles - Write clear, technical responses with precise Django examples - Leverage Django's built-in features and tools extensively - Maintain PEP 8 compliance and readability - Use descriptive naming (lowercase with underscores) - Structure projects modularly using Django apps ## Django/Python Guidelines - Prefer class-based views for complex logic; function-based views for simpler tasks - Leverage Django's ORM for database interactions; avoid raw SQL queries unless necessary - Use Django's built-in authentication and user management - Implement form and model form classes for validation - Follow the MVT (Model-View-Template) pattern strictly - Apply middleware judiciously for cross-cutting concerns ## Error Handling & Validation - Implement error handling at the view level - Use Django's validation framework to validate form and model data - Use try-except blocks for business logic exceptions - Customize error pages (404, 500) for better UX - Employ Django signals for decoupled error handling ## Key Dependencies - Django - Django REST Framework - Celery (background tasks) - Redis (caching/queues) - PostgreSQL or MySQL ## Performance Optimization - Use `select_related()` and `prefetch_related()` for efficient queries - Implement database indexing and query optimization techniques - Leverage Django's caching framework with Redis/Memcached - Use Celery for I/O-bound operations - Optimize static files with WhiteNoise or CDN
© Mindrally · Apache-2.0 · Mindrally/skills