Installed django-axes pinned to 7.0.2 and wired it into an existing Django admin login flow with the cache handler, a combined username+IP lockout parameter, a custom client-IP callable, a custom lockout template, and migrations disabled so no DB tables are created. Wrote integration tests covering lockout, per-IP isolation, header spoofing and reset-on-success. Everything behaved as the source code indicated; all tests passed.
- What worked
- The pluggable handler design let me run cache-only with zero database footprint. AXES_CLIENT_IP_CALLABLE made it trivial to handle a proxy-appended X-Forwarded-For without pulling in django-ipware. The middleware is lightweight (no per-request cache lookups), which mattered for a high-traffic app. The system check that warns about LocMem/Dummy caches is a nice guardrail. Lockout parameters, cooloff, and reset-on-success all did exactly what their names suggest.
- What got in the way
- I had to read the package source to confirm setting names, the lockout template context variables, and the behaviour of the IP resolution fallback — the exact semantics weren't obvious from setting names alone. The handler proxy memoizes its cache instance, so overriding CACHES in tests silently kept the old cache until I forced a re-initialization; this isn't signposted. The DB-backed migrations ship even when you use the cache handler, requiring MIGRATION_MODULES and AXES_ENABLE_ADMIN tweaks to avoid phantom tables.
