django
Skill28 starsChanged 5 months agoMITView on GitHub
Use when building Django applications. Covers ORM query performance, model design, migrations, Django REST Framework, security defaults, and testing.
- Reads credentials
10 other projects use a version of this.
Adopted by
Most recently taken up by
- 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
- gingerminds/claude-skillstheir own version, first seen Jul 24, 2026
- youlaitech/youlai-skillstheir own version, first seen Jul 14, 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★ 56same name
- wsvincent/django-skills★ 36same name
- dekoza/oh-my-slop★ 4same name
- rishapgandhi/python-skills★ 4same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- gingerminds/claude-skills★ 2same name
- imankulov/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 repository137 other files it gives its agents.
- agent-instructionsSkill
- agent-memorySkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- mcp-serverSkill
- ml-pipelineSkill
- model-selectionSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- event-driven-architectureSkill
- fastapiSkill
- graphqlSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- git-workflowSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- aws-cdkSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 56
Never use objects.all() in a view without pagination.
- Very specific: line 59
Run manage.py check --deploy in CI.
“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
Purpose
Build Django applications that use the ORM efficiently and the framework's security defaults correctly. Most Django performance problems are one missing select_related away from being fixed.
When to Use
- Building or reviewing a Django application or DRF API.
- Diagnosing slow views caused by the ORM.
- Writing migrations that must run against a large table.
- Auditing Django security settings before launch.
Capabilities
- ORM:
select_related,prefetch_related, annotations, subqueries, bulk operations. - Model design: constraints, indexes, and validation at the database level.
- Migrations, including zero-downtime patterns for large tables.
- Django REST Framework: serializers, viewsets, permissions, pagination.
- Security: the settings that must not be wrong in production.
Inputs
- The application, its models, and the slow view or endpoint if there is one.
- Table sizes, for anything involving migrations.
- Deployment environment and settings module.
Outputs
- Views with a bounded, predictable query count.
- Migrations that do not lock a large table.
- Settings that pass
manage.py check --deploy.
Workflow
- Count the queries —
assertNumQueriesin tests,django-debug-toolbarin development. An N+1 is invisible until you count. - Fix them at the queryset —
select_relatedfor forward foreign keys (a join),prefetch_relatedfor reverse and many-to-many (a second query). Not both, not neither. - Push work into the database —
annotate,aggregate,bulk_create,update. A loop that saves each object issues one query per iteration. - Constrain at the database —
UniqueConstraint,CheckConstraint. Application-level validation does not survive concurrency or a shell script. - Migrate safely — On a large table, adding a column with a default rewrites it. Add nullable, backfill in batches, then set the default.
- Check the deploy settings —
DEBUG = False,ALLOWED_HOSTS,SECURE_*,SECRET_KEYfrom the environment.
Best Practices
queryset.count()inside a template loop is a query per iteration. Annotate the count once..only()and.defer()are traps if the deferred field is later accessed — each access is a new query. Use them only when profiling shows they help.- Never use
objects.all()in a view without pagination. It will work fine until the table has a million rows. - Signals create action at a distance and make tests fragile. Prefer explicit calls in a service function.
bulk_createdoes not callsave()or fire signals — which is the point, and also the footgun. Know which behavior you need.- Run
manage.py check --deployin CI. It catches the settings that turn into vulnerabilities.
Examples
Removing an N+1 and pushing aggregation into the database:
# Before: 1 query for orders + 1 per customer + 1 per line-item count = ~2N+1.
orders = Order.objects.filter(status="open")
for order in orders:
print(order.customer.name, order.items.count())
# After: 2 queries total, count computed by the database.
orders = (
Order.objects
.filter(status="open")
.select_related("customer") # join
.annotate(item_count=Count("items")) # aggregate in SQL
)
for order in orders:
print(order.customer.name, order.item_count)Database-level constraint rather than a hopeful clean():
class Subscription(models.Model):
tenant = models.ForeignKey(Tenant, on_delete=models.CASCADE)
period_start = models.DateField()
period_end = models.DateField()
class Meta:
constraints = [
models.UniqueConstraint(
fields=["tenant", "period_start"],
name="uniq_subscription_period",
),
models.CheckConstraint(
check=models.Q(period_end__gt=models.F("period_start")),
name="period_end_after_start",
),
]Notes
select_relatedon a nullable foreign key produces a LEFT JOIN and can multiply rows through a chain. Check the generated SQL withstr(qs.query)when the query count looks right but the latency does not.- Adding an index on a large PostgreSQL table blocks writes unless you use
AddIndexConcurrentlyinside aNonAtomicmigration. - DRF's
ModelSerializerwill happily expose every field on the model. Always listfieldsexplicitly;__all__is how private fields end up in a public API.
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.

