axes/management/commands/axes_list_attempts.py
raw| 1 | from django.core.management.base import BaseCommand |
| 2 | |
| 3 | from axes.models import AccessAttempt |
| 4 | |
| 5 | |
| 6 | class Command(BaseCommand): |
| 7 | help = "List access attempts" |
| 8 | |
| 9 | def handle(self, *args, **options): |
| 10 | for obj in AccessAttempt.objects.all(): |
| 11 | self.stdout.write( |
| 12 | f"{obj.ip_address}\t{obj.username}\t{obj.failures_since_start}" |
| 13 | ) |