checks
Django system checks for hx-requests.
These surface configuration mistakes at startup / manage.py check rather
than as silent runtime surprises.
Functions
|
Warn when a Django auth mixin (any |
check_auth_mixin_ordering
- check_auth_mixin_ordering(app_configs, **kwargs)
Warn when a Django auth mixin (any
AccessMixinsubclass –LoginRequiredMixin,PermissionRequiredMixin,UserPassesTestMixin) is listed afterHtmxViewMixinin a view’s base classes.HtmxViewMixin.dispatchhands HTMX requests off to the resolvedHxRequestwithout callingsuper().dispatch(), so any auth mixin ordered after it never runs on the HTMX path – authentication is silently skipped for HTMX requests with no error. Auth mixins must come beforeHtmxViewMixinso theirdispatchruns first (or authorization must be enforced per-handler on theHxRequest).Best effort: only view classes that have been imported are visible via
__subclasses__; this catches the common case at startup.