django
Skill15 starsChanged 42 days agoMITView on GitHub
Expert Django assistance covering ORM, models, class-based views, admin interface, migrations, and Django REST Framework. Use when developing robust, scalable Python web applications and REST APIs.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
- gingerminds/claude-skillstheir own version, first seen Sep 23, 2026
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
- Mariatta/claude-skillstheir own version, first seen Aug 7, 2026
- imankulov/skillstheir own version, first seen Aug 2, 2026
- wsvincent/django-skillstheir own version, first seen Aug 2, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- microsoft/debugpy★ 2.5ksame name
- youlaitech/youlai-skills★ 63same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- wsvincent/django-skills★ 32same name
- dekoza/oh-my-slop★ 4same name
- imankulov/skills★ 4same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- gingerminds/claude-skills★ 2same name
- Mariatta/claude-skills★ 2same name
- conjure-3301/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 2 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 115
Use select_related for ForeignKeys and prefetch_related for M2M:
- Very specific: line 129
Always use select_related and prefetch_related to eliminate N+1 database query bottlenecks.
- Very specific: line 131
Run migrations in CI pipelines (python manage.py check --deploy and makemigrations --check).
- Very specific: line 132
Use Bulk operations (bulk_create, bulk_update) when modifying more than 10 records.
- Very specific: line 136
Leave DEBUG = True in production environments.
- Distinctive: line 137
Put business logic inside templates or views.
- Distinctive: line 138
Use synchronous external HTTP calls in view handlers.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Django
Django is a high-level Python web framework encouraging rapid development, pragmatic clean design, built-in ORM security, robust migrations, and asynchronous view support.
When to Use
- Full-Featured Python Web Applications: Batteries-included web development with built-in ORM, admin panel, auth, and migrations.
- Content Management & Enterprise Backends: Developing robust database-backed backends with automatic admin dashboards.
- High-Throughput REST APIs: Building secure APIs using Django REST Framework (DRF) or Django Ninja.
- Async Python Web Services: Utilizing ASGI, async views, and background tasks on Django 5.x.
Quick Start
# models.py
from django.db import models
class Post(models.Model):
title = models.CharField(max_length=200)
# New in 5.0: Database generated field
slug = models.GeneratedField(
expression=models.functions.Concat(models.F("title"), models.Value("-slug")),
output_field=models.CharField(max_length=205),
db_persist=True,
)Core Concepts
Django ORM Models & Migrations
Relational schema definition with indexing and query optimizations:
from django.db import models
from django.utils import timezone
class Customer(models.Model):
email = models.EmailField(unique=True, db_index=True)
full_name = models.CharField(max_length=255)
created_at = models.DateTimeField(default=timezone.now)
class Meta:
ordering = ['-created_at']
def __str__(self):
return f"{self.full_name} ({self.email})"
class Order(models.Model):
customer = models.ForeignKey(Customer, on_delete=models.CASCADE, related_name='orders')
total_amount = models.DecimalField(max_digits=10, decimal_places=2)
is_fulfilled = models.BooleanField(default=False)
placed_at = models.DateTimeField(auto_now_add=True)
class Meta:
indexes = [
models.Index(fields=['customer', 'is_fulfilled']),
]High-Performance Querying with select_related & prefetch_related
Eliminating N+1 database queries:
from django.shortcuts import render
from .models import Order
def order_report_view(request):
# select_related performs SQL JOIN for 1-to-1 and ForeignKey
# prefetch_related performs separate batch query for ManyToMany
orders = Order.objects.filter(is_fulfilled=True) \
.select_related('customer') \
.only('id', 'total_amount', 'customer__full_name')[:50]
return render(request, 'orders/report.html', {'orders': orders})Fast Async APIs with Django Ninja
Type-safe REST API endpoints powered by Pydantic:
from ninja import NinjaAPI, Schema
from typing import List
api = NinjaAPI(title="Inventory API", version="1.0.0")
class ProductOut(Schema):
id: int
name: str
price: float
in_stock: bool
@api.get("/products", response=List[ProductOut])
async def list_products(request):
# Async view querying ASGI backend
return [
{"id": 1, "name": "Mechanical Keyboard", "price": 129.99, "in_stock": True}
]Common Patterns
Prefetching Related Objects to Prevent N+1 Queries
Problem: Accessing foreign keys or many-to-many relationships in template/API loops generates hundreds of database queries.
Solution:
Use select_related for ForeignKeys and prefetch_related for M2M:
# Fetches books and authors in a single optimized JOIN query
books = Book.objects.filter(is_published=True) .select_related("publisher") .prefetch_related("authors") .order_by("-published_date")[:50]
for book in books:
print(f"{book.title} published by {book.publisher.name}")Best Practices
Do:
- Always use
select_relatedandprefetch_relatedto eliminate N+1 database query bottlenecks. - Configure
django-environto keep secret keys, database credentials, and API tokens out of code. - Run migrations in CI pipelines (
python manage.py check --deployandmakemigrations --check). - Use
Bulkoperations (bulk_create,bulk_update) when modifying more than 10 records.
Don't:
- Leave
DEBUG = Truein production environments; it leaks memory and sensitive stack traces. - Put business logic inside templates or views; encapsulate domain rules in model methods or service layers.
- Use synchronous external HTTP calls in view handlers; use async views or Celery/Redis tasks.
Troubleshooting
| Error | Cause | Solution |
django.db.utils.OperationalError: no such table | Database migrations have not been applied. | Run python manage.py migrate. |
CSRF verification failed. Request aborted (403) | POST form submitted without {% csrf_token %} tag. | Include {% csrf_token %} in HTML form or verify CSRF cookie headers in API requests. |
FieldError: Cannot resolve keyword '...' into field | Misspelled field name in filter() or order_by(). | Check model definition and ensure double underscores __ for relationship lookups. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

