agentleFS
dekozadekoza/oh-my-slop/skills/reference/django/SKILL.md

django

Skill4 starsChanged 8 months agoUnlicenseView on GitHub

Use when working with Django code — looking up ORM, view, template, form, admin, auth, settings, testing, or async patterns, or debugging Django-specific behavior. Triggers on: "Django", "manage.py", "models.py", "ORM", "migration", "template tag", "Django admin", or any file inside a Django project layout. This is the reference skill — the mandatory workflow checklist lives in django-discipline.

Files
SKILL.md

Django 6.0 Framework Reference

Route the task to the matching reference file below and read only what the task needs. Workflow enforcement — migrations, linting, N+1 prevention, import discipline, rename safety, testing guardrails — lives solely in the django-discipline skill, which applies to every change in a Django project alongside this reference.

Critical Gotchas

  1. Model field verification — Read the actual model definition before writing queries or test fixtures. Do not guess field names.
  2. auto_now=True bypass — Fields with auto_now=True cannot be set via .save(). Use .objects.filter().update(field=value) to override.
  3. TemplateResponse for deferred rendering — Use TemplateResponse when middleware must inspect or modify template context after the view returns. Use render() for simple views where context is final.
  4. URL patterns are hierarchical — Child URLconf should NOT repeat the parent prefix. Catch-all patterns (path("")) must be LAST in urlpatterns.
  5. Template tags don't work in static files — {{ var|safe }} and {% url ... %} are NOT processed in external .js / .css files — they're served as static assets. Solutions: inline <script> config block, data attributes on DOM elements, or a JSON endpoint view.
  6. JSON traps — Values stored in TextField are strings; call json.loads() before dictionary-style access. Django renders Python lists in templates as [\'item\'] (single quotes); use json.dumps() in the view context for valid JS/JSON.
  7. Templates own markup — Inline HTML in Python is last resort and stays under ~60 characters (hard max 66) per indentation block; beyond that, move it into a template/include/partial.
  8. Form validation at the model level — Django forms inherit model validation. Define custom validation in model clean() and form clean_*() methods.

Routing

FileUse for
references/models-orm.mdDefining models, querysets, migrations, ORM optimization
references/views-urls.mdBuilding views, URL routing, class-based views
references/templates.mdCreating or extending templates
references/forms-validation.mdBuilding forms, validation, form rendering
references/admin.mdCustomizing Django admin
references/auth-security.mdAuthentication, permissions, security patterns
references/settings-config.mdSettings, configuration, environment-specific setup
references/testing.mdWriting tests (unit, integration, or E2E — includes Playwright/live_server pitfalls)
references/middleware-signals.mdMiddleware, signals, request/response cycle
references/architecture.mdProject structure, patterns, architectural decisions
references/async-tasks.mdAsync views, tasks, celery, background jobs
references/django6-new.mdDjango 6.0 new features and deprecations
references/internals.mdDjango internals, metaprogramming, deep framework behavior

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.