Reduce complexity and leave the enabled mode to be used
with the toggleable decorator that disables functionality
when AXES_ENABLED is set to False for testing etc.
This conforms with the previous behaviour and logic flow.
Fixes#634
The Django import system seems to produce errors
in certain configurations and especially when
MIGRATION_MODULES configuration is set globally.
This is most probably caused by misbehaving or cyclic
Python module imports in the Django application
instrumentatation chain that come up when the
MIGRATION_MODULES configuration is altered.
This patch migrates to the standard Python logging system
use and has less overhead and complexity for users as well.
Having a configurable logging prefix does not produce
a lot of benefits and is less flexible than having
all individual module logging configurations accessible
through the module __name__ parameter in Axes.
For example axes.handlers.* or axes.backends.*
are separately configurable in the new scheme
whereas they would have been both bundled under
the AXES_LOGGER log configuration.
- Define a base handler API with method signatures
- Move proxy handler to a separate path for importability
- Implement a database handler with clean external dependencies
- Change the authentication backend and decorators to use the authentication backend
This enables clean pluggable authentication backend definitions that users
can override and specialize with e.g. cached handlers in their own packages.
Signed-off-by: Aleksi Häkli <aleksi.hakli@iki.fi>
Implements a proxied API which enables overriding
a handler backend with a user supplied implementation.
Fixes#399
Signed-off-by: Aleksi Häkli <aleksi.hakli@iki.fi>
Fixes#389
Remove monkey-patching from the application loader phase
and use the Django authentication stack for lockout signals.
Utilize custom AUTHENTICATION_BACKENDS and MIDDLEWARE with signals
with backwards compatible implementation of features.
Update documentation, configuration and migration instructions
to match the new configuration and improve the code commentation.
Signed-off-by: Aleksi Häkli <aleksi.hakli@iki.fi>