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.

License: MIT Claude Code Django Python

πŸ“¦ 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:

FeatureDjango VersionPlugin Support
Background Tasks Framework6.0+βœ… /django:task
Built-in CSP Middleware6.0+βœ… /django:csp
Template Partials6.0+βœ… /django:partial
Composite Primary Keys5.2+βœ… /django:model
Async ORM Operations5.1+βœ… /django:view
Async Session API5.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)

Django4.25.05.15.26.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

PythonDjango 4.2Django 5.0–5.2Django 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.json schema: changed hooks from 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 PKs
  • create-project - Start Django project with Django 6.0 features
  • setup-drf - Configure DRF with async support
  • setup-auth - Configure custom user model and async authentication
  • setup-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 debugging
  • optimize - Query optimization, N+1 detection, async performance tuning
  • upgrade - 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

CommandDescriptionStatus
/django:signalGenerate Django signals with best practicesπŸ“‹ Planned
/django:middlewareCreate custom middleware with async supportπŸ“‹ Planned
/django:managementGenerate custom management commandsπŸ“‹ Planned
/django:templateCreate template with block inheritanceπŸ“‹ Planned
/django:cacheConfigure caching strategies (Redis, Memcached)πŸ“‹ Planned
/django:api-viewsetGenerate DRF ViewSets with CRUD + actionsπŸ“‹ Planned

Upcoming Skills

SkillDescriptionStatus
setup-htmxConfigure HTMX with Django 6.0 template partialsπŸ“‹ Planned
setup-websocketDjango Channels + WebSocket setupπŸ“‹ Planned
setup-redisRedis caching and session backendπŸ“‹ Planned
setup-testingPytest + factory-boy + coverage setupπŸ“‹ Planned
setup-dockerDocker + docker-compose configurationπŸ“‹ Planned
setup-celeryLegacy Celery setup (for Django < 6.0)πŸ“‹ Planned
create-apiScaffold REST API from models (DRF)πŸ“‹ Planned
create-graphqlGraphQL API setup with Strawberry/GrapheneπŸ“‹ Planned

Upcoming Agents

AgentDescriptionStatus
refactorIdentify code smells and suggest refactoringπŸ“‹ Planned
securityScan for security vulnerabilities (OWASP Top 10)πŸ“‹ Planned
test-generatorAuto-generate tests from existing codeπŸ“‹ Planned
doc-generatorGenerate 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

DocumentPathCoverage
Coding Standards.claude/plugins/claude-django/docs/standards.mdNaming conventions, project structure, model/view/URL standards, testing guidelines
Best Practices.claude/plugins/claude-django/docs/best-practices.mdSecurity, performance, deployment, DRF API patterns, database design
Large Project Patterns.claude/plugins/claude-django/docs/large-project-patterns.mdPer-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


Made with ❀️ for open-source community