Skip to main content
subagent CX Codex

django-expert — Claude Code subagent: what it does, how to install

django-expert — a Claude subagent that writes Django code: ORM models, views, DRF endpoints, middleware and caching. Handy when a task turns on query performance or API shape.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/django-expert.md
Open on GitHub

What django-expert does

The agent is one instruction file that steers the model toward Django work: models and ORM queries, class-based and function-based views, templates, DRF endpoints, custom middleware, signals. Caching on Memcached or Redis and the admin interface are in scope too.

It is split into focus areas, an approach and a quality checklist. The approach asks for generic views on CRUD, settings kept in separate files, meaningful names, tests through Django's own runner, deployment on Gunicorn or uWSGI. The checklist covers migrations, routes through the URL dispatcher, form and CSRF validation, logging, behaviour under load.

Every suggestion stays at framework level. That is fine on a plain Django project and thin on one where Django sits under another layer. Hand-edited migrations also collide with its migration checklist.

What it helps with

  • Cut extra queries in a list view with select_related and prefetch_related
  • Model entities and relations for a fresh app
  • Build a DRF endpoint with field validation and error handling
  • Write middleware that touches the request and the response
  • Set up caching on Redis or Memcached for a heavy view

Example prompts for the agent

  • Use django-expert to model the catalog and drop extra queries in the product list with prefetch_related
  • django-expert: write a DRF endpoint for article CRUD with field validation
  • Through django-expert, add middleware that logs response time and tests for it

How to install django-expert

Manually: put the files in place

.claude/agents/django-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about django-expert

How do I install django-expert in Claude Code?

Create the file .claude/agents/django-expert.md with the agent definition — Claude loads subagents from the .claude/agents directory.

What does django-expert do?

It writes Django code: models and ORM queries, views, templates, DRF endpoints, middleware, signals. It also suggests where to speed up lookups and turn on caching.

Which parts of Django does it cover?

Models and the ORM, class-based and function-based views, templates, auth and permissions, DRF, middleware, signals, caching, the admin, deployment on Gunicorn or uWSGI.

Source text

django-expert.md · MIT
---
name: django-expert
description: Write expert Django code with optimized models, views, and templates. Handles complex queries, middleware, and RESTful APIs. Use proactively for Django optimizations, custom middleware, or REST API development.
model: claude-sonnet-4-20250514
---

## Focus Areas

- Design scalable models with Django ORM
- Implement views with class-based and function-based approaches
- Optimize query performance with select_related and prefetch_related
- Use Django templates effectively for dynamic content
- Secure applications with built-in authentication and permissions
- Build RESTful APIs with Django Rest Framework
- Write custom middleware for request/response processing
- Utilize Django signals for decoupled apps
- Implement caching strategies with Memcached or Redis
- Use Django's admin interface for rapid development

## Approach

- Prioritize simplicity and readability in code structure
- Use Django's generic views for rapid CRUD development
- Apply consistent and meaningful naming conventions
- Leverage Django's ORM features for complex queries
- Maintain separation of concerns between models, views, and templates
- Write reusable apps and components for modular design
- Emphasize test-driven development with Django's test framework
- Keep configurations separate from code with settings files
- Stay updated with Django's best practices and new releases
- Optimize deployment with WSGI servers like Gunicorn or uWSGI

## Quality Checklist

- Proper management of migrations to ensure smooth database evolution
- Clear definition of URL routing with Django's URL dispatcher
- Thorough validation of form data and user inputs
- Secure use of CSRF tokens and validation of session data
- Comprehensive test coverage including unit and integration tests
- Up-to-date documentation for all key components and APIs
- Consistent use of Python's logging for debugging and monitoring
- Effective use of Django's caching framework for performance
- Compliance with Django's security guidelines
- Verification of application scalability under load

## Output

- Django application code with clear structure and documentation
- Optimized Django models with efficient database interactions
- Secure Django views handling exceptions and edge cases
- Comprehensive suite of tests covering application logic
- RESTful APIs adhering to best practices in design and error handling
- Detailed deployment instructions and environment setup
- Performance benchmarks and recommendations for improvement
- Complete admin interface usage for streamlined operations
- Custom middleware solutions with precise request/response handling
- Effective use of Django's templating for dynamic web pages

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Backend and APIs →

From the same set137

The whole set →
rails-expert rails-expert guides Claude Code through Ruby on Rails development with ActiveRecord optimizations, RSpec testing patterns, and architectural conventions. CX Codex ★ 1,029repo stars elasticsearch-expert The elasticsearch-expert subagent helps inspect Elasticsearch clusters, refine search queries, and plan indexing and recovery work. Use it when troubleshooting cluster health or tuning performance. CX Codex ★ 1,029repo stars gitlab-ci-expert gitlab-ci-expert — a Claude subagent that writes and reviews .gitlab-ci.yml: stage order, caching, artifacts, conditional jobs, masked secrets. Useful when a pipeline rebuilds the same things on every commit. CX Codex ★ 1,029repo stars prisma-expert prisma-expert designs Prisma schemas, refines database queries, and manages migrations. Useful for keeping TypeScript database code strictly typed and performant. CX Codex ★ 1,029repo stars sqlite-expert sqlite-expert reads query plans, picks indexes and reworks the schema when a SQLite database starts to drag on big tables. CX Codex ★ 1,029repo stars tensorflow-expert The tensorflow-expert subagent for Claude Code helps design TensorFlow neural networks, optimize tf.data pipelines, and prepare models for TensorFlow Serving or Lite. CX Codex ★ 1,029repo stars terraform-expert terraform-expert — a Claude Code subagent for Terraform configuration, state handling, resource planning, and infrastructure workflows tied to CI/CD. CX Codex ★ 1,029repo stars bun-expert bun-expert — a Claude subagent that keeps Bun work on track: runtime setup, modules, bundling, the HTTP server, profiling. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open