checks

Django system checks for hx-requests.

These surface configuration mistakes at startup / manage.py check rather than as silent runtime surprises.

Functions

check_auth_mixin_ordering(app_configs, **kwargs)

Warn when a Django auth mixin (any AccessMixin subclass --

check_auth_mixin_ordering

check_auth_mixin_ordering(app_configs, **kwargs)

Warn when a Django auth mixin (any AccessMixin subclass – LoginRequiredMixin, PermissionRequiredMixin, UserPassesTestMixin) is listed after HtmxViewMixin in a view’s base classes.

HtmxViewMixin.dispatch hands HTMX requests off to the resolved HxRequest without calling super().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 before HtmxViewMixin so their dispatch runs first (or authorization must be enforced per-handler on the HxRequest).

Best effort: only view classes that have been imported are visible via __subclasses__; this catches the common case at startup.