Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/hashgraph-online-django-htmx/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 34% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 35% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 24% | 0% |
Use HTMX to keep Django templates, views, forms, permissions, and server-side validation in charge while adding focused partial-page updates. Prefer plain Django first, then add the smallest HTMX behavior that improves the workflow.
In generated django-saas-starter projects:
django-htmx is installed and django_htmx.middleware.HtmxMiddleware addsrequest.htmx.
htmx.min.js is copied from npm to frontend/static/vendors/js/ and loadedby frontend/templates/base_app.html and frontend/templates/base_landing.html.
X-CSRFToken during htmx:configRequest andset window.htmx.config.historyRestoreAsHxRequest = false. Do not duplicate this setup in feature templates.
state, and lightweight transitions.
Use these skills for deeper htmx guidance, then translate back to Django forms, views, templates, permissions, and tests:
htmx-endpoint-design for request/response contracts, targets, swaps,out-of-band updates, and events.
htmx-recipes for active search, pagination, infinite scroll, polling,dialogs, click-to-edit, boosted links, and other common patterns.
htmx-security for XSS, sanitization, CSP, CSRF, and htmx history-cache risk.htmx-realtime for polling, SSE, and WebSocket tradeoffs.htmx-interactivity for Alpine.js coordination, event boundaries, and localstate outside replaceable targets.
htmx-js-api for programmatic requests, htmx.process, and event wiring.Load only the files needed for the current task:
| Need | Read | | --- | --- | | Django view branching, response helpers, forms, validation | references/django-view-patterns.md | | Template targets, swaps, OOB updates, Alpine events, recipe notes | references/template-interaction-patterns.md | | Security rules, Django tests, response assertions, reference docs | references/testing-security.md |
session value.
request.htmx branching when the full page andpartial share the same query and permissions.
contract or different mutation rules.
frontend/templates/<app>/partials/... or the local app template folder.
returns.
request.htmx.
request.htmx only after the same auth, permission, and data-loadingpath has run.
@vary_on_headers("HX-Request") on cacheable views that return differentfull-page and partial content for the same URL.
django_htmx.http helpers over hand-writing HTMX headers:HttpResponseClientRedirect, HttpResponseClientRefresh, HttpResponseLocation, HttpResponseStopPolling, push_url(), replace_url(), retarget(), reswap(), reselect(), and trigger_client_event().
{% csrf_token %}in forms even when the base HTMX header is configured.
status 200 unless the project explicitly handles 4xx or 422 swaps.
method override pattern for DELETE.
updates, and cross-component server facts; Alpine owns local-only state, keyboard/menu behavior, temporary UI state, and transitions.
hx-push-url="true" only when the new state deserves a real browser URL,and ensure the pushed URL can render a full page on direct load and refresh.
arbitrary request parameters. Use explicit URLs and views.
hx-trigger="keyup" or polling without debounce, throttle, or aclear stop condition.
form, or message patterns.
Other measured skills in the registry, with their headline benchmark lift.