Catalog / Plugins

Django

Django workflow guidance for database performance, server-rendered UI, jobs, MCP servers, TDD, functional testing, deployment testing, and app behavior.

Codingdjangodatabaseperformanceormhtmxalpinejsbackground-jobsmcptestingtddseleniumformsdeploymentcipytest

Included Skills

Use when adding, changing, or debugging Alpine.js behavior in Django-rendered templates, especially when Alpine.js coexists with HTMX partial updates.

alpinejsdjangofrontendhtmx

Optimize Django and pytest-django test execution in CI with cache configuration, slow-test splitting, database reuse strategy, parallel workers, pytest-xdist, CircleCI/GitHub Actions/Jenkins/Travis patterns, and full-coverage safeguards. Use when CI test jobs are slow, flaky under parallelism, missing slow-test coverage, or need a local-vs-CI test command design.

djangotestingcipytest

Diagnose and improve slow Django database-backed endpoints with evidence-first profiling, query-plan review, index selection, ORM loading fixes, batching, database-side computation, materialized views, and pagination choices. Use when a Django view, API, job, report, queryset, or database query is slow and the right optimization path is not obvious.

djangodatabaseperformanceorm

Move Django performance-sensitive Python loops into database-side computation with annotations, aggregates, filtered aggregates, F expressions, functions, Subquery, OuterRef, Exists, Window expressions, db_default, and GeneratedField. Use when Django code counts, sums, filters, flags, ranks, or derives values in Python after fetching rows.

djangodatabaseaggregationorm

Make Django deployment changes test-driven across Docker, production settings, Gunicorn, WhiteNoise/static files, environment variables, Ansible/server setup, staging smoke tests, and release checks. Use when containerizing Django, preparing production config, debugging staging, automating deploys, or deciding what deployment behavior functional tests should verify.

djangotdddeploymentdocker

Test-drive Django validation across model constraints, forms, ModelForms, views, template errors, duplicate handling, and redirects. Use when adding or refactoring Django forms, surfacing validation errors, deciding model-vs-form-vs-view responsibility, or preventing invalid input from being saved.

djangotddformsvalidation

Build and review HTMX interactions in Django server-rendered projects, especially generated django-saas-starter apps. Use when adding hx attributes, partial template responses, request.htmx branching, django-htmx response headers, forms, swaps, triggers, redirects, polling, boosted links or forms, or coordinating HTMX with Alpine.js local state.

djangohtmxserver-rendered-ui

Design safe Django and PostgreSQL indexes from measured query plans, including B-tree, composite, covering, partial, expression, GIN/JSONB, BRIN, and concurrent migration patterns. Use when a Django query plan suggests missing or mismatched indexes, a production table needs an index without write downtime, or existing indexes need review.

djangodatabaseindexespostgres

Model, migrate, refresh, and verify PostgreSQL materialized views in Django for expensive report or dashboard queries that can tolerate stale data. Use when ORM/index/query rewrites are not enough, the result is read often, freshness can be bounded, and a Django app needs unmanaged models, RunSQL migrations, refresh commands, or concurrent refresh.

djangodatabasematerialized-viewspostgres

Optimize Django ORM query loading by fixing N+1 queries, duplicate related-object queries, over-fetching, serializer/template query loops, and inappropriate select_related, prefetch_related, only, or defer usage. Use when a Django page, API, admin view, template, serializer, or queryset issues too many queries or loads more model data than needed.

djangoormquerysetsperformance

Drive Django features with outside-in and double-loop TDD: user story, Selenium or functional test, focused Django unit/integration tests, minimal implementation, and refactor. Use when starting or changing Django behavior with tests-first workflow, red/green/refactor, working-state-to-working-state refactors, or deciding which layer should own the next test.

djangotddtestingfunctional-tests

Improve Django and Django REST Framework pagination for large querysets using bounded page sizes, stable ordering, indexed ordering, offset limits, keyset pagination, DRF CursorPagination, and count-query tradeoffs. Use when list pages, admin views, APIs, exports, or infinite scroll become slow, inconsistent, or memory-heavy as result sets grow.

djangopaginationperformancequerysets

Django Q2

Django

Use when adding, changing, testing, or debugging Django Q2 background tasks, scheduled jobs, qcluster workers, Redis broker configuration, or ORM broker fallback in Django projects.

djangodjango-q2background-jobsredis

Read and compare Django/PostgreSQL query execution plans using QuerySet.explain(), EXPLAIN, EXPLAIN ANALYZE, scan types, joins, estimates, actual timing, buffers, and row counts. Use when one SQL query dominates Django latency or when an index, ORM rewrite, pagination change, or materialized view needs proof from a query plan.

djangodatabasequery-planspostgres

Find the Django ORM code and request path responsible for slow SQL by using APM traces, slow query logs, Django Debug Toolbar, query logging, and local reproduction. Use when a Django database performance issue is suspected but the exact queryset, view, serializer, template, or job causing it is not yet proven.

djangodatabaseprofilingapm

Process large Django querysets and write-heavy jobs with memory-safe reads, values/values_list, iterator chunking, set-based update/delete, bulk_create, bulk_update, F expressions, Func expressions, and batch sizing. Use when a Django command, task, migration, report, or loop reads or writes many rows and is slow, memory-heavy, or query-heavy.

djangoquerysetsbatch-processingorm

Design, debug, and maintain Django Selenium functional tests with live server setup, explicit waits, test isolation, page objects, screenshots, CI artifacts, and staging checks. Use when browser tests are flaky, too slow, duplicated, failing in CI, need a page pattern, or should verify a Django user journey end to end.

djangotddseleniumfunctional-tests

Manage Django spikes and de-spiking with tests: branch experiments, exploratory code, learning capture, functional tests against spiked behavior, revert-and-rebuild, custom auth flows, email/token models, and dependency seams. Use when a Django feature was prototyped quickly and needs to be turned into production-quality tested code.

djangotddspikesauth

Mock Django test boundaries safely with override_settings, pytest settings, autospecced unittest.mock objects, output/input capture, requests-mock, VCR.py, outbound HTTP blocking, and time-freezing tools. Use when tests need to replace settings, HTTP calls, time, command output, stdin, or external services without broad fragile MagicMock patches.

djangotestingmockinghttp

Design faster, clearer Django test data and test structure with factories, setUpTestData, SimpleTestCase/TestCase choices, fixture-file cleanup, query optimization, and unit-vs-integration boundaries. Use when Django tests create too much data, rely on slow fixtures, overuse TransactionTestCase, duplicate setup, or need refactoring for speed without losing coverage.

djangotestingtest-datafactories

Safely parallelize Django and pytest-django test suites with Django --parallel, pytest-xdist, test isolation checks, randomized order detection, shared-resource sharding, locks, and load balancing. Use when enabling parallel tests, diagnosing failures under parallel execution, handling flaky Django tests, or making caches, files, queues, and external resources safe across workers.

djangotestingparallelizationpytest

Improve slow Django test suites through measured profiling, safe test settings, database and migration tuning, parallel execution, test-data cleanup, and CI workflow changes. Use when Django or pytest-django tests are slow, CI test jobs take too long, database setup dominates runtime, or a user asks for a prioritized speedup plan rather than isolated test fixes.

djangotestingperformancepytest

Profile and measure slow Django test suites with Django's runner, pytest-django, shell timing, py-spy, cProfile, pytest durations, and profiler visualizations. Use when a Django project has slow tests, unclear test-runtime bottlenecks, CI timing problems, startup overhead, database setup overhead, or a request to find the slowest tests before optimizing.

djangotestingprofilingpytest

Use when adding, changing, deploying, testing, or debugging FastMCP MCP servers in existing Django apps, including ASGI mounting, stdio or sidecar servers, Django ORM access from MCP tools, auth and permissions, Streamable HTTP deployment, and MCP client tests.

fastmcpdjangomcpasgi