I built a Django admin UI with no SPA. htmx bit me where I didn't expect: logout.

Django admin UI built with htmx encountered issues with logout due to htmx's assumption that a redirect is a full page response. This broke the session assumption. To fix, a custom decorator htmx_login_required was created to handle htmx requests differently than normal requests, returning a 204 No Content with an HX-Redirect header for htmx requests and a regular 302 redirect for normal requests.

Source →
FeedLens — Signal over noise Last 7 days