django-developer-skill/SKILL.md
Expert Django developer specializing in Async Views, Django Ninja (FastAPI-like), and HTMX patterns for modern full-stack apps.
npx skillsauth add 404kidwiz/claude-supercode-skills django-developerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Provides Django and Python web development expertise specializing in async views, Django Ninja APIs, and modern full-stack patterns. Builds robust Python web applications with HTMX for server-driven UI, Django Channels for real-time features, and Celery for background tasks.
What is the project goal?
│
├─ **API First (Headless)**
│ ├─ Type-safe / Modern? → **Django Ninja** (Pydantic-based, fast)
│ └─ Legacy / Enterprise? → **DRF** (Batteries included, heavy)
│
├─ **Full Stack (Monolith)**
│ ├─ Complex UI (SPA)? → **Django + React/Vue** (API separation)
│ └─ Dynamic but Simple? → **Django + HTMX** (Hypermedia-driven, no build step)
│
└─ **Real-Time**
├─ Simple updates? → **HTMX Polling** or **SSE**
└─ Complex/Bi-directional? → **Django Channels (WebSockets)**
| Feature | Sync (WSGI) | Async (ASGI) | Recommendation |
|---------|-------------|--------------|----------------|
| DB Queries | User.objects.get() | await User.objects.aget() | Use Async for high-concurrency I/O (proxies, chat). |
| Views | def view(req): | async def view(req): | Keep Sync for CPU-bound tasks. |
| Middlewares | Standard | Async-compatible | Ensure middleware stack supports async. |
select_related (Foreign Keys) and prefetch_related (M2M).GinIndex for JSONB search, BTree for standard lookups.bulk_create and bulk_update for batches > 100 items.Red Flags → Escalate to database-optimizer:
for loop.iterator())Goal: Implement an "Infinite Scroll" or "Click to Edit" without writing React.
Steps:
View (Python)
def contact_list(request):
contacts = Contact.objects.all()
# If HTMX request, return only the rows (partial)
if request.htmx:
template = "partials/contact_rows.html"
else:
template = "contact_list.html"
return render(request, template, {"contacts": contacts})
Template (contact_list.html)
<!-- Search triggers server request on keyup -->
<input type="text"
name="search"
hx-get="/contacts"
hx-trigger="keyup changed delay:500ms"
hx-target="#contact-rows">
<table>
<tbody id="contact-rows">
{% include "partials/contact_rows.html" %}
</tbody>
</table>
Goal: High-throughput API endpoint using async/await.
Steps:
View Definition
# views.py
from asgiref.sync import sync_to_async
async def dashboard_stats(request):
# Parallel DB queries
user_count_task = User.objects.acount()
order_count_task = Order.objects.acount()
user_count, order_count = await asyncio.gather(
user_count_task,
order_count_task
)
return JsonResponse({"users": user_count, "orders": order_count})
Middleware Compatibility
async_capable = True).sync_to_async.Use case: Keeping Views and Models skinny.
# services.py
class OrderService:
@staticmethod
def create_order(user, items_data):
with transaction.atomic():
order = Order.objects.create(user=user)
for item in items_data:
OrderItem.objects.create(order=order, **item)
# Complex logic here
PaymentGateway.charge(order)
return order
Use case: Reusable filters.
class PublishedManager(models.Manager):
def get_queryset(self):
return super().get_queryset().filter(status='PUBLISHED', pub_date__lte=timezone.now())
class Article(models.Model):
# ...
objects = models.Manager() # Default
published = PublishedManager() # Custom
Use case: WebSocket handling.
# consumers.py
class ChatConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_name = "lobby"
await self.channel_layer.group_add(self.room_name, self.channel_name)
await self.accept()
async def disconnect(self, close_code):
await self.channel_layer.group_discard(self.room_name, self.channel_name)
async def receive(self, text_data):
# Broadcast to group
await self.channel_layer.group_send(
self.room_name,
{"type": "chat_message", "message": text_data}
)
_card.html) → UI Dev styles them.EXPLAIN ANALYZE output from ORM generated SQL.Dockerfile → DevOps configures Gunicorn/Uvicorn.development
Expert in automating Excel workflows using Node.js (ExcelJS, SheetJS) and Python (pandas, openpyxl).
content-media
Expert in designing durable, scalable workflow systems using Temporal, Camunda, and Event-Driven Architectures.
tools
Use when user needs WordPress development, theme or plugin creation, site optimization, security hardening, multisite management, or scaling WordPress from small sites to enterprise platforms.
tools
Expert in Windows Server, Active Directory (AD DS), Hybrid Identity (Entra ID), and PowerShell automation.