From playbooks-virtuoso
Complete reference for all 33 Django framework components including Models, Views, Templates, Forms, Admin, Auth, Caching, and more. Covers ORM patterns, class-based views, middleware, signals, and deployment for Python 3.10+ and Django 6.0.
How this skill is triggered — by the user, by Claude, or both
Slash command
/playbooks-virtuoso:django-componentsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Complete reference for all 33 Django components - patterns, APIs, configuration, and best practices for Python 3.10+ and Django 6.0.
references/admin.mdreferences/async.mdreferences/auth.mdreferences/cache.mdreferences/class-based-views.mdreferences/content-types.mdreferences/database-functions.mdreferences/deployment.mdreferences/email.mdreferences/files.mdreferences/forms.mdreferences/i18n.mdreferences/logging.mdreferences/management-commands.mdreferences/messages.mdreferences/middleware.mdreferences/migrations.mdreferences/models.mdreferences/pagination.mdreferences/querysets.mdComplete reference for all 33 Django components - patterns, APIs, configuration, and best practices for Python 3.10+ and Django 6.0.
from django.db import models
class Article(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(unique=True)
content = models.TextField()
published = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)
author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
class Meta:
ordering = ['-created_at']
def __str__(self):
return self.title
# urls.py
from django.urls import path
from . import views
urlpatterns = [
path('articles/<int:pk>/', views.article_detail, name='article_detail'),
]
# views.py
from django.shortcuts import render, get_object_or_404
def article_detail(request, pk):
article = get_object_or_404(Article, pk=pk)
return render(request, 'articles/detail.html', {'article': article})
from django.views.generic import ListView, DetailView
class ArticleListView(ListView):
model = Article
queryset = Article.objects.filter(published=True)
paginate_by = 20
class ArticleDetailView(DetailView):
model = Article
slug_field = 'slug'
from django.db.models import Q, F, Count
# Complex filtering
articles = Article.objects.filter(
Q(title__icontains='django') | Q(content__icontains='django'),
published=True,
).exclude(
author__is_active=False
).annotate(
comment_count=Count('comments')
).order_by('-created_at')
from django import forms
class ArticleForm(forms.ModelForm):
class Meta:
model = Article
fields = ['title', 'slug', 'content', 'published']
def clean_title(self):
title = self.cleaned_data['title']
if len(title) < 5:
raise forms.ValidationError('Title must be at least 5 characters.')
return title
from django.views.decorators.cache import cache_page
@cache_page(60 * 15) # 15 minutes
def article_list(request):
articles = Article.objects.filter(published=True)
return render(request, 'articles/list.html', {'articles': articles})
from django.db.models.signals import post_save
from django.dispatch import receiver
@receiver(post_save, sender=Article)
def notify_on_publish(sender, instance, created, **kwargs):
if instance.published and created:
send_notification(instance)
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Process pending articles'
def add_arguments(self, parser):
parser.add_argument('--limit', type=int, default=100)
def handle(self, *args, **options):
count = process_articles(limit=options['limit'])
self.stdout.write(self.style.SUCCESS(f'Processed {count} articles'))
from django.test import TestCase
class ArticleTests(TestCase):
def setUp(self):
self.article = Article.objects.create(
title='Test Article',
slug='test-article',
content='Content here',
published=True,
)
def test_article_detail_view(self):
response = self.client.get(f'/articles/{self.article.pk}/')
self.assertEqual(response.status_code, 200)
self.assertContains(response, 'Test Article')
npx claudepluginhub krzysztofsurdy/code-virtuoso --plugin agents-virtuosoProvides Django patterns, best practices, and guides for database models/querysets, security/auth/permissions, DRF APIs/serializers/viewsets, testing, error handling, and performance/caching. Auto-activates on manage.py, settings.py, or django package.
Provides 2025 Django patterns for project structure, settings, naming conventions, models with type hints and indexes, async support. Activates on Django models, views, URLs, forms, templates, commands, structure.
Provides Django 5.x expertise for scalable web apps using async views, DRF, Celery, Django Channels, with architecture, testing, security, and deployment guidance.