From 9e7b1f97673f21939e43745dc7ceac7014071f23 Mon Sep 17 00:00:00 2001 From: Mariano Vassallo Date: Thu, 20 Mar 2014 13:13:52 -0300 Subject: [PATCH] Admin command to list login attemps --- axes/management/commands/axes_list_attempts.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 axes/management/commands/axes_list_attempts.py diff --git a/axes/management/commands/axes_list_attempts.py b/axes/management/commands/axes_list_attempts.py new file mode 100644 index 0000000..7915549 --- /dev/null +++ b/axes/management/commands/axes_list_attempts.py @@ -0,0 +1,13 @@ +from django.core.management.base import BaseCommand +from django.core.management.base import CommandError + +from axes.models import AccessAttempt + +class Command(BaseCommand): + args = '' + help = ("List login attempts") + + def handle(self, *args, **kwargs): + for at in AccessAttempt.objects.all(): + print "%s %s %s" % (at.ip_address, at.username, at.failures) +