mirror of
https://github.com/jazzband/django-axes.git
synced 2026-03-16 22:30:23 +00:00
Refine and streamline startup log. The new output is on one line and
looks like this: AXES: BEGIN version 5.32.1.dev14+g038dc7c.d20220507, blocking by IP only Resolves #884.
This commit is contained in:
parent
038dc7cd97
commit
012fde1caf
1 changed files with 5 additions and 10 deletions
15
axes/apps.py
15
axes/apps.py
|
|
@ -30,20 +30,15 @@ class AppConfig(apps.AppConfig):
|
|||
|
||||
# Skip startup log messages if Axes is not set to verbose
|
||||
if settings.AXES_VERBOSE:
|
||||
log.info("AXES: BEGIN LOG")
|
||||
log.info(
|
||||
"AXES: Using django-axes version %s",
|
||||
get_distribution("django-axes").version,
|
||||
)
|
||||
|
||||
if settings.AXES_ONLY_USER_FAILURES:
|
||||
log.info("AXES: blocking by username only.")
|
||||
mode = "blocking by username only"
|
||||
elif settings.AXES_LOCK_OUT_BY_COMBINATION_USER_AND_IP:
|
||||
log.info("AXES: blocking by combination of username and IP.")
|
||||
mode = "blocking by combination of username and IP"
|
||||
elif settings.AXES_LOCK_OUT_BY_USER_OR_IP:
|
||||
log.info("AXES: blocking by username or IP.")
|
||||
mode = "blocking by username or IP"
|
||||
else:
|
||||
log.info("AXES: blocking by IP only.")
|
||||
mode = "blocking by IP only"
|
||||
log.info("AXES: BEGIN version %s, %s", get_distribution("django-axes").version, mode)
|
||||
|
||||
def ready(self):
|
||||
self.initialize()
|
||||
|
|
|
|||
Loading…
Reference in a new issue