Admin command to list login attemps

This commit is contained in:
Mariano Vassallo 2014-03-20 13:13:52 -03:00
parent 778f208cc1
commit 9e7b1f9767

View file

@ -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)