Claude Django πΈ
Boost your Django productivity with intelligent commands, skills, and autonomous agents.
Claude Django πΈ
Django Developer plugin for Claude Code - Boost your Django productivity with intelligent commands, skills, and agents.
π¦ Installation
# Add the marketplace
/plugin marketplace add dev-muhammad/claude-django
# Install the plugin
/plugin install claude-django@claude-django-marketplace
Restart Claude Code to load the plugin.
β¨ Features
π Quick Commands
Slash commands for instant Django code generation:
/django:model- Generate models with composite primary keys (Django 5.2+)/django:view- Create async function/class-based views (Django 5.1+)/django:serializer- Generate DRF serializers/django:admin- Configure admin registration/django:url- Set up URL patterns/django:form- Create forms and modelforms/django:migrate- Migration helpers/django:test- Generate test cases/django:task- Create background tasks (Django 6.0)/django:csp- Configure Content Security Policy (Django 6.0)/django:partial- Create template partials (Django 6.0)
π― Interactive Skills
Guided workflows for complex tasks:
- create-app - Scaffold Django app with composite PKs
- create-project - Start a new Django project with Django 6.0 features
- setup-drf - Configure Django REST Framework with async support
- setup-auth - Configure custom user model and async authentication
- setup-tasks - Set up Django 6.0 built-in background tasks
- setup-csp - Configure Django 6.0 Content Security Policy
- migrate-to-async - Migrate views to async (Django 5.1+)
- migrate-to-composite-pk - Migrate models to composite primary keys
π€ Autonomous Agents
Smart helpers that work independently:
- debug - Analyze Django 6.0 errors and trace issues
- optimize - Query optimization, N+1 detection, async performance tuning
- upgrade - Help upgrade Django projects to latest version
π Django 6.0 & Django 5.2 Features
This plugin fully supports both the latest and current Django versions:
| Feature | Django Version | Plugin Support |
|---|---|---|
| Background Tasks Framework | 6.0+ | β
/django:task |
| Built-in CSP Middleware | 6.0+ | β
/django:csp |
| Template Partials | 6.0+ | β
/django:partial |
| Composite Primary Keys | 5.2+ | β
/django:model |
| Async ORM Operations | 5.1+ | β
/django:view |
| Async Session API | 5.1+ | β
setup-auth skill |
π Usage
Commands
# Generate a model (Django 5.2+ composite PK support)
/django:model
# Create an async view (Django 5.1+)
/django:view
# Create a background task (Django 6.0)
/django:task
# Configure CSP (Django 6.0)
/django:csp
Skills
# Create a new Django app with composite PKs
Use the "create-app" skill when Claude asks what to help with
# Setup Django 6.0 background tasks
Use the "setup-tasks" skill for task framework configuration
# Migrate to async views
Use the "migrate-to-async" skill for async migration
π Supported Versions
Django Support (as of February 2026)
| Django | 4.2 | 5.0 | 5.1 | 5.2 | 6.0 |
|---|---|---|---|---|---|
| Status | β | β | β | β | β |
Current Versions:
- Django 5.2.11 - Stable and mature (recommended for production)
- Django 6.0.2 - Latest with new features (background tasks, CSP, partials)
Python Support
| Python | Django 4.2 | Django 5.0β5.2 | Django 6.0 |
|---|---|---|---|
| 3.10 | β | β | β |
| 3.11 | β | β | β |
| 3.12 | β | β | β |
| 3.13 | β | β | β |
| 3.14 | β | β | β |
Python 3.12+ is required for Django 6.0. Django 5.2 is the last version supporting Python 3.10/3.11.
Which Django Version Should You Use?
Use Django 5.2.11 () if:
- β Building a production application
- β Need long-term stability (3 years security updates)
- β Prefer proven, battle-tested features
- β Don't need the absolute latest features
Use Django 6.0.2 () if:
- β Need built-in background tasks (no Celery required)
- β Want native CSP middleware for security
- β Need template partials for component architecture
- β Building cutting-edge applications
- β οΈ Accept shorter support cycle (~8 months)
π― Key Features by Django Version
Django 6.0.2 π
- β Built-in background tasks framework (no Celery needed!)
- β Native CSP middleware for security
- β Template partials for component-based architecture
- β Improved async ORM operations
Django 5.2.11 β
- β Composite primary keys support
- β Automatic model imports in shell
- β Simplified form field handling
- β Recommended for production use
Django 5.1
- β Async SessionBase API
- β Enhanced async view support
Django 4.2 (Previous -)
- β οΈ End of Life - upgrade to 5.2 or 6.0 recommended
π Examples
Django 6.0 Background Task
from django.core.mail import send_mail
from django.tasks import task
@task
def email_users(emails, subject, message):
return send_mail(subject, message, None, emails)
# Enqueue for background execution
email_users.enqueue(
emails=["[email protected]"],
subject="You have a message",
message="Hello there!",
)
Django 5.2 Composite Primary Key
class OrderItem(models.Model):
order = models.ForeignKey('Order', on_delete=models.CASCADE, primary_key=True)
product = models.ForeignKey('Product', on_delete=models.CASCADE, primary_key=True)
quantity = models.IntegerField()
Django 5.1 Async View
import aiohttp
async def product_detail(request, pk):
product = await Product.objects.aget(pk=pk)
async with aiohttp.ClientSession() as session:
async with session.get(f'https://api.example.com/stock/{pk}') as resp:
stock = await resp.json()
return render(request, 'product.html', {'product': product, 'stock': stock})
π Changelog
v0.1.1 (February 2026) - Bug Fix
- Fixed
hooks.jsonschema: changedhooksfrom array to record format to match Claude Code plugin specification
v0.1.0 (February 2026) - Initial Release π
Django 6.0.2 () + Django 5.2.11 ()
Commands (11 total):
/django:model- Generate models with composite primary keys (Django 5.2+)/django:view- Create async function/class-based views (Django 5.1+)/django:serializer- Generate DRF serializers/django:admin- Configure admin registration/django:url- Set up URL patterns/django:form- Create Django forms/django:migrate- Migration helpers/django:test- Generate test cases/django:task- Create background tasks (Django 6.0) π/django:csp- Configure CSP middleware (Django 6.0) π/django:partial- Create template partials (Django 6.0) π
Skills (8 total):
create-app- Scaffold Django app with composite PKscreate-project- Start Django project with Django 6.0 featuressetup-drf- Configure DRF with async supportsetup-auth- Configure custom user model and async authenticationsetup-tasks- Set up Django 6.0 background tasks framework πsetup-csp- Configure Django 6.0 Content Security Policy πmigrate-to-async- Migrate views to async (Django 5.1+) πmigrate-to-composite-pk- Migrate models to composite primary keys π
Agents (3 total):
debug- Analyze Django 6.0 errors including async debuggingoptimize- Query optimization, N+1 detection, async performance tuningupgrade- Help upgrade Django projects to latest version π
Hooks (1 total):
validate-model- Validate Django model definitions
Supported Versions:
- Django: 4.2, 5.0, 5.1, 5.2 (), 6.0 ()
- Python: 3.12, 3.13, 3.14 (Django 6.0); 3.10+ (Django 4.2β5.2)
Documentation:
- Comprehensive README with Django vs guide
- MIT License
- Contributing guidelines
π Future Plans
This plugin is actively maintained and growing. Here's what we're planning:
Upcoming Commands
| Command | Description | Status |
|---|---|---|
/django:signal | Generate Django signals with best practices | π Planned |
/django:middleware | Create custom middleware with async support | π Planned |
/django:management | Generate custom management commands | π Planned |
/django:template | Create template with block inheritance | π Planned |
/django:cache | Configure caching strategies (Redis, Memcached) | π Planned |
/django:api-viewset | Generate DRF ViewSets with CRUD + actions | π Planned |
Upcoming Skills
| Skill | Description | Status |
|---|---|---|
| setup-htmx | Configure HTMX with Django 6.0 template partials | π Planned |
| setup-websocket | Django Channels + WebSocket setup | π Planned |
| setup-redis | Redis caching and session backend | π Planned |
| setup-testing | Pytest + factory-boy + coverage setup | π Planned |
| setup-docker | Docker + docker-compose configuration | π Planned |
| setup-celery | Legacy Celery setup (for Django < 6.0) | π Planned |
| create-api | Scaffold REST API from models (DRF) | π Planned |
| create-graphql | GraphQL API setup with Strawberry/Graphene | π Planned |
Upcoming Agents
| Agent | Description | Status |
|---|---|---|
| refactor | Identify code smells and suggest refactoring | π Planned |
| security | Scan for security vulnerabilities (OWASP Top 10) | π Planned |
| test-generator | Auto-generate tests from existing code | π Planned |
| doc-generator | Generate API docs from code | π Planned |
Enhancements
- Django 6.1+ - Support for upcoming Django 6.1 features
- Python 3.14+ - Support for latest Python features
- DRF Integration - Deeper DRF ViewSet and router support
- Type Stubs - Add type hints for better IDE support
- Performance Profiling - Built-in profiling agent
- CI/CD Templates - GitHub Actions, GitLab CI workflows
- Testing Framework - Automated plugin testing
Community Contributions Welcome!
We'd love help with:
- Documentation improvements
- Bug fixes and edge cases
- Additional language support
- Framework integrations (Next.js, Vue, React)
- Real-world usage examples
Have an idea? Open an issue or PR! We're friendly to new contributors.
π€ Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- Built for Claude Code
- Inspired by the Django community
- Supports latest Django innovations
π Plugin Documentation
The plugin includes comprehensive reference documentation for Django development best practices:
Included Reference Guides
| Document | Path | Coverage |
|---|---|---|
| Coding Standards | .claude/plugins/claude-django/docs/standards.md | Naming conventions, project structure, model/view/URL standards, testing guidelines |
| Best Practices | .claude/plugins/claude-django/docs/best-practices.md | Security, performance, deployment, DRF API patterns, database design |
| Large Project Patterns | .claude/plugins/claude-django/docs/large-project-patterns.md | Per-class file organization, base models, custom QuerySets, scalability |
β
Insight βββββββββββββββββββββββββββββββββββββ
These reference documents are automatically loaded into context when using Django plugin commands. This ensures all generated code follows consistent, production-ready standardsβno need to manually reference best practices during development.
βββββββββββββββββββββββββββββββββββββββββββββββββ
Quick Access
The docs folder is located at:
.claude/plugins/claude-django/docs/
βββ README.md # This overview
βββ standards.md # Coding standards & conventions
βββ best-practices.md # Security, performance & deployment
βββ large-project-patterns.md # Enterprise-scale patterns
π Resources
- Django 5.2 Documentation
- Django 6.0 Documentation
- Django 6.0 Release Notes
- Django 5.2 Release Notes
- Django REST Framework
- Django Versions Policy
Made with β€οΈ for open-source community