[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EMV9P3XWHPTMM34XV9YWZA":3,"skill-same:01M7EMV9P3XWHPTMM34XV9YWZA":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7EMV9P3XWHPTMM34XV9YWZA","django-pro",null,"Django guidance — project structure, ORM mastery, admin, auth, async views, and production deployment.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-django-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: django-pro\ndescription: Django guidance — project structure, ORM mastery, admin, auth, async views, and production deployment.\ncategory: development\n---\n\n## Overview\n\nDjango is Python's batteries-included web framework: ORM, admin, auth, migrations, and templating ship together with a strong opinion about project layout. That completeness is its superpower — teams move fast without assembling a stack — and its trap, when projects fight the framework instead of using it. This skill covers the Django way done well: fat models, thin views, the ORM's query behavior, and what to configure before going live.\n\n## When to use\n\n- Building a full-stack Python web app or admin-backed API.\n- Taming N+1 queries, slow ORM queries, or migration pain.\n- Structuring a growing Django project (apps, settings, services).\n- Hardening Django for production (security settings, static files, DB).\n- Deciding between Django, DRF, FastAPI, or Rails-style frameworks.\n- Customizing the Django admin for internal tooling.\n- Adding caching or async views to an existing Django app.\n\n## Core concepts\n\n- **MTV and the request path.** URLconf → view → template\u002Fresponse. Keep views thin: parse input, call domain logic, return a response. Business rules belong in models, managers, or service modules — not in views.\n- **The ORM is a query builder.** QuerySets are lazy; nothing hits the DB until evaluated. Learn `select_related` (FK joins) and `prefetch_related` (M2M\u002Freverse FK) — they eliminate the N+1 queries that sink Django apps. Use `.only()`\u002F`.defer()` and `.values()` to slim wide tables.\n- **Migrations are code.** Never edit a migration that's been applied anywhere shared; write new ones. Use `sqlmigrate` to inspect generated SQL, keep migrations small and reversible, and run them with zero-downtime patterns (add nullable column → backfill → add constraint).\n- **Apps are boundaries.** Split by domain (`billing`, `users`, `orders`), not by technical layer. Each app owns its models, views, and templates. Cross-app imports signal a missing shared app or a boundary violation.\n- **Settings per environment.** One `settings.py` with environment overrides beats copy-pasted files. Validate required env vars at startup (`django-environ` or similar); fail fast on missing secrets.\n- **Auth and admin.** Django's auth (users, groups, permissions, sessions) plus the auto-generated admin cover most back-office needs. Customize the admin per model (list_display, list_filter, search_fields) — an unconfigured admin is both slow and dangerous.\n- **Async support is partial.** Async views and ORM methods exist, but much of Django (middleware, ORM internals) still runs sync. Use async for I\u002FO-bound views with async-compatible libraries; don't expect Node-style throughput from a sync stack.\n- **Managers and QuerySets.** Custom managers (`objects = OrderManager()`) encapsulate query logic so views stay dumb; chainable QuerySet methods compose. Put \"how we query X\" in exactly one place.\n- **Signals.** `post_save`\u002F`m2m_changed` decouple side effects — and create invisible coupling when overused. Prefer explicit service calls; reserve signals for cross-app concerns (audit logs, cache invalidation).\n- **Caching framework.** Per-view, template-fragment, and low-level caching with Redis\u002FMemcached backends. Cache the expensive, invalidate deliberately — stale caches are a correctness bug, not a performance feature.\n- **Testing tools.** Django's `TestCase` wraps each test in a transaction with fast rollback; use `SimpleTestCase` for non-DB tests. Prefer factories (factory_boy) over brittle JSON fixtures for test data.\n- **Don't reimplement contrib.** Sessions, flash messages, pagination, sitemaps, humanize — check `django.contrib` before adding a dependency; it's maintained and already installed.\n\n## Practical workflow\n\n1. **Scaffold cleanly.** `django-admin startproject config .` (project package named `config`, not the app name), then one app per domain. Split settings: `settings\u002Fbase.py`, `settings\u002Fprod.py`.\n2. **Model the domain.** Write models with managers\u002Fquerysets encapsulating query logic; add indexes for every filtered\u002Fordered field (`db_index`, `Meta.indexes`); prefer `DecimalField` for money, `DateTimeField` with timezone support on.\n   ```python\n   class Order(models.Model):\n       customer = models.ForeignKey(Customer, on_delete=models.PROTECT, related_name=\"orders\")\n       status = models.CharField(max_length=20, choices=Status.choices, db_index=True)\n       total = models.DecimalField(max_digits=10, decimal_places=2)\n       created_at = models.DateTimeField(auto_now_add=True, db_index=True)\n       class Meta:\n           indexes = [models.Index(fields=[\"customer\", \"-created_at\"])]\n   ```\n3. **Build views + serializers.** For APIs use DRF or Ninja; validate input with serializers, paginate every list endpoint, and throttle public ones.\n   - Use `ModelViewSet` judiciously — explicit `APIView`s are clearer for non-CRUD behavior.\n4. **Audit queries.** Install django-debug-toolbar in dev; in CI, assert query counts on hot endpoints (`assertNumQueries`). Fix N+1s with `select_related`\u002F`prefetch_related` before they ship.\n5. **Harden settings for prod.** `DEBUG=False`, `ALLOWED_HOSTS` set, `SECURE_SSL_REDIRECT`, `SESSION_COOKIE_SECURE`, `CSRF_COOKIE_SECURE`, `SECURE_HSTS_SECONDS`; static files via WhiteNoise or a CDN; media on object storage, never local disk.\n   - Run `python manage.py check --deploy` — Django's own production checklist catches the common misses.\n6. **Configure the admin.** `list_display`, `list_filter`, `search_fields`, `readonly_fields` for audit columns; override `get_queryset` with `select_related` for list pages; restrict sensitive models with custom permissions.\n7. **Add caching where it pays.** Cache expensive querysets and rendered fragments; version cache keys on deploy; monitor hit rates — an unused cache is just complexity.\n8. **Deploy.** Gunicorn\u002Fuvicorn workers behind a reverse proxy; run migrations as a separate deploy step (not in the web process); collect static at build time; back up the DB before migrating.\n\n   ```python\n   # settings\u002Fprod.py essentials\n   DEBUG = False\n   ALLOWED_HOSTS = env.list(\"ALLOWED_HOSTS\")\n   SECURE_HSTS_SECONDS = 31_536_000\n   SECURE_SSL_REDIRECT = True\n   SESSION_COOKIE_SECURE = CSRF_COOKIE_SECURE = True\n   ```\n\n## Common pitfalls\n\n- **N+1 queries** from template loops and serializer nesting — the #1 Django performance bug; profile query counts, not just wall time.\n- **Fat views, anemic models** — logic scattered across views becomes untestable; push it into models\u002Fmanagers\u002Fservices.\n- **Editing applied migrations** — corrupts every environment's migration state; always add a new migration.\n- **`DEBUG=True` in production** — leaks tracebacks, env details, and enables the debug toolbar attack surface.\n- **Naive datetimes** — set `USE_TZ=True` and store UTC; convert at the presentation edge only.\n- **Unbounded querysets in admin\u002Flist views** — paginate everything; a missing paginator on a million-row table is an outage.\n- **Running migrations inside web dynos** — concurrent migrates race; run once per deploy from a dedicated step.\n- **Signal spaghetti** — side effects hidden in signals firing in surprising order; prefer explicit calls.\n- **Unindexed foreign keys on large tables** — joins and cascading checks slow to a crawl; index FKs and filtered columns.\n- **Storing uploads on local disk** — doesn't survive multi-server deploys; use object storage via django-storages.\n- **Evaluating querysets repeatedly** — re-evaluating the same queryset in a loop instead of caching it in a variable; evaluate once, reuse the list.\n- **Ignoring `CONN_MAX_AGE`** — opening a new DB connection per request adds latency; use persistent connections plus a pooler (PgBouncer) in production.\n- **Fixture-based tests rotting** — giant JSON fixtures that break on every model change; factories express intent and survive refactors.\n","## Overview\n\nDjango is Python's batteries-included web framework: ORM, admin, auth, migrations, and templating ship together with a strong opinion about project layout. That completeness is its superpower — teams move fast without assembling a stack — and its trap, when projects fight the framework instead of using it. This skill covers the Django way done well: fat models, thin views, the ORM's query behavior, and what to configure before going live.\n\n## When to use\n\n- Building a full-stack Python web app or admin-backed API.\n- Taming N+1 queries, slow ORM queries, or migration pain.\n- Structuring a growing Django project (apps, settings, services).\n- Hardening Django for production (security settings, static files, DB).\n- Deciding between Django, DRF, FastAPI, or Rails-style frameworks.\n- Customizing the Django admin for internal tooling.\n- Adding caching or async views to an existing Django app.\n\n## Core concepts\n\n- **MTV and the request path.** URLconf → view → template\u002Fresponse. Keep views thin: parse input, call domain logic, return a response. Business rules belong in models, managers, or service modules — not in views.\n- **The ORM is a query builder.** QuerySets are lazy; nothing hits the DB until evaluated. Learn `select_related` (FK joins) and `prefetch_related` (M2M\u002Freverse FK) — they eliminate the N+1 queries that sink Django apps. Use `.only()`\u002F`.defer()` and `.values()` to slim wide tables.\n- **Migrations are code.** Never edit a migration that's been applied anywhere shared; write new ones. Use `sqlmigrate` to inspect generated SQL, keep migrations small and reversible, and run them with zero-downtime patterns (add nullable column → backfill → add constraint).\n- **Apps are boundaries.** Split by domain (`billing`, `users`, `orders`), not by technical layer. Each app owns its models, views, and templates. Cross-app imports signal a missing shared app or a boundary violation.\n- **Settings per environment.** One `settings.py` with environment overrides beats copy-pasted files. Validate required env vars at startup (`django-environ` or similar); fail fast on missing secrets.\n- **Auth and admin.** Django's auth (users, groups, permissions, sessions) plus the auto-generated admin cover most back-office needs. Customize the admin per model (list_display, list_filter, search_fields) — an unconfigured admin is both slow and dangerous.\n- **Async support is partial.** Async views and ORM methods exist, but much of Django (middleware, ORM internals) still runs sync. Use async for I\u002FO-bound views with async-compatible libraries; don't expect Node-style throughput from a sync stack.\n- **Managers and QuerySets.** Custom managers (`objects = OrderManager()`) encapsulate query logic so views stay dumb; chainable QuerySet methods compose. Put \"how we query X\" in exactly one place.\n- **Signals.** `post_save`\u002F`m2m_changed` decouple side effects — and create invisible coupling when overused. Prefer explicit service calls; reserve signals for cross-app concerns (audit logs, cache invalidation).\n- **Caching framework.** Per-view, template-fragment, and low-level caching with Redis\u002FMemcached backends. Cache the expensive, invalidate deliberately — stale caches are a correctness bug, not a performance feature.\n- **Testing tools.** Django's `TestCase` wraps each test in a transaction with fast rollback; use `SimpleTestCase` for non-DB tests. Prefer factories (factory_boy) over brittle JSON fixtures for test data.\n- **Don't reimplement contrib.** Sessions, flash messages, pagination, sitemaps, humanize — check `django.contrib` before adding a dependency; it's maintained and already installed.\n\n## Practical workflow\n\n1. **Scaffold cleanly.** `django-admin startproject config .` (project package named `config`, not the app name), then one app per domain. Split settings: `settings\u002Fbase.py`, `settings\u002Fprod.py`.\n2. **Model the domain.** Write models with managers\u002Fquerysets encapsulating query logic; add indexes for every filtered\u002Fordered field (`db_index`, `Meta.indexes`); prefer `DecimalField` for money, `DateTimeField` with timezone support on.\n   ```python\n   class Order(models.Model):\n       customer = models.ForeignKey(Customer, on_delete=models.PROTECT, related_name=\"orders\")\n       status = models.CharField(max_length=20, choices=Status.choices, db_index=True)\n       total = models.DecimalField(max_digits=10, decimal_places=2)\n       created_at = models.DateTimeField(auto_now_add=True, db_index=True)\n       class Meta:\n           indexes = [models.Index(fields=[\"customer\", \"-created_at\"])]\n   ```\n3. **Build views + serializers.** For APIs use DRF or Ninja; validate input with serializers, paginate every list endpoint, and throttle public ones.\n   - Use `ModelViewSet` judiciously — explicit `APIView`s are clearer for non-CRUD behavior.\n4. **Audit queries.** Install django-debug-toolbar in dev; in CI, assert query counts on hot endpoints (`assertNumQueries`). Fix N+1s with `select_related`\u002F`prefetch_related` before they ship.\n5. **Harden settings for prod.** `DEBUG=False`, `ALLOWED_HOSTS` set, `SECURE_SSL_REDIRECT`, `SESSION_COOKIE_SECURE`, `CSRF_COOKIE_SECURE`, `SECURE_HSTS_SECONDS`; static files via WhiteNoise or a CDN; media on object storage, never local disk.\n   - Run `python manage.py check --deploy` — Django's own production checklist catches the common misses.\n6. **Configure the admin.** `list_display`, `list_filter`, `search_fields`, `readonly_fields` for audit columns; override `get_queryset` with `select_related` for list pages; restrict sensitive models with custom permissions.\n7. **Add caching where it pays.** Cache expensive querysets and rendered fragments; version cache keys on deploy; monitor hit rates — an unused cache is just complexity.\n8. **Deploy.** Gunicorn\u002Fuvicorn workers behind a reverse proxy; run migrations as a separate deploy step (not in the web process); collect static at build time; back up the DB before migrating.\n\n   ```python\n   # settings\u002Fprod.py essentials\n   DEBUG = False\n   ALLOWED_HOSTS = env.list(\"ALLOWED_HOSTS\")\n   SECURE_HSTS_SECONDS = 31_536_000\n   SECURE_SSL_REDIRECT = True\n   SESSION_COOKIE_SECURE = CSRF_COOKIE_SECURE = True\n   ```\n\n## Common pitfalls\n\n- **N+1 queries** from template loops and serializer nesting — the #1 Django performance bug; profile query counts, not just wall time.\n- **Fat views, anemic models** — logic scattered across views becomes untestable; push it into models\u002Fmanagers\u002Fservices.\n- **Editing applied migrations** — corrupts every environment's migration state; always add a new migration.\n- **`DEBUG=True` in production** — leaks tracebacks, env details, and enables the debug toolbar attack surface.\n- **Naive datetimes** — set `USE_TZ=True` and store UTC; convert at the presentation edge only.\n- **Unbounded querysets in admin\u002Flist views** — paginate everything; a missing paginator on a million-row table is an outage.\n- **Running migrations inside web dynos** — concurrent migrates race; run once per deploy from a dedicated step.\n- **Signal spaghetti** — side effects hidden in signals firing in surprising order; prefer explicit calls.\n- **Unindexed foreign keys on large tables** — joins and cascading checks slow to a crawl; index FKs and filtered columns.\n- **Storing uploads on local disk** — doesn't survive multi-server deploys; use object storage via django-storages.\n- **Evaluating querysets repeatedly** — re-evaluating the same queryset in a loop instead of caching it in a variable; evaluate once, reuse the list.\n- **Ignoring `CONN_MAX_AGE`** — opening a new DB connection per request adds latency; use persistent connections plus a pooler (PgBouncer) in production.\n- **Fixture-based tests rotting** — giant JSON fixtures that break on every model change; factories express intent and survive refactors.\n",{"name":5,"category":24,"description":7},"development","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-django-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill django-pro",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill django-pro",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill django-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-django-pro\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]