Production Checklist
Validate production settings, caching, static assets, and request behavior before shipping HyperDjango pages.
This page focuses on the practical details. Use the quick links below to move to the previous, next, or related docs.
HyperDjango spans template rendering, runtime JS, and caching layers. Small config mismatches across these layers are a common source of release regressions.
Runtime and App Settings
- Set
HYPER_FRONTEND_DIRto your deployed frontend source directory. - Set
HYPER_VITE_OUTPUT_DIRto built static asset output. - Set
HYPER_DEV = Falsein production. - Ensure collectstatic includes Vite output and
hyperdjango/static.
See the Assets and Vite page for the main asset build and manifest flow.
Caching and Action Responses
Action responses include no-store/no-cache and Vary headers for Hyper request metadata.
- keep reverse proxies from overriding these headers on action endpoints
- avoid caching action JSON/partial responses in CDN edge caches
- preserve
X-Hyper-Request-ID,Last-Event-ID, andX-Hyper-Switch-Depth
For command-to-query handoffs, verify the originating mutation uses retry: false,
commits durable state before returning action.switch_to(...), and can be recovered by refresh if
the response is lost. Audit destination watchers as genuinely side-effect-free and test
their ordered replay or idempotent replacement-patch contract under reconnection. Set
HYPER_SWITCH_ACTION_MAX_DEPTH only if the default four-switch loop bound is too small.
Security
- keep Django CSRF middleware enabled
- send CSRF cookie or render
{% csrf_token %}in base layout - if using CSP, use Django's CSP middleware/context processor or otherwise
expose
request._csp_nonceso HyperDjango can nonce rendered asset tags, runtime scripts, and dynamically activated scripts - if
HYPER_DEBUG_TOOLBAR=True, confirm that exposing sanitized traces, SQL, request metadata, replay, pause, and clear controls is intentional and protected by the deployment's access policy; otherwise disable it
Client Contracts
- use stable DOM IDs/selectors for server-targeted HTML and delete patches
- enable strict targets (
hyper-strict-targets) in QA to catch selector drift - define fallback behavior for missing JS (full-page paths should still work)
Performance
- use
sync: "replace"or explicit keys for rapid interactions (search, typeahead) - use
hyper-loading-delayto avoid flicker on fast requests - prefer block rendering (
render_block) for hot action paths
Testing
- run routing checks in CI:
python manage.py hyper_routes - add tests for route conflict cases and action response contracts
- test back/forward navigation with enhanced links/forms
- verify 422 validation flows for form-driven
$action(..., {}, { form })submits - for every command-to-query handoff, interrupt the watcher in an E2E test and assert:
the command was sent once, the watcher reconnected with a distinct command/watcher
request ID pair, only the watcher inherited its own
Last-Event-ID, and keyed loading remained active until the final watcher completed - test configured switch-depth rejection and external abort/replacement of the complete chain when an application uses multi-switch workflows
Deployment Validation
- start app with production settings and run key routes manually
- verify assets resolve from manifest (no Vite dev server URLs)
- verify toasts/signals/swaps on at least one action-heavy page
- verify target-not-found errors are absent in browser logs