I am trying to get a login form I have in django to only allow three login attempts before redirecting to a “login help” page. I am currently using the builtin “django.contrib.auth.views.login” view with a custom template. How do I force it to redirect to another page after n failed login attempts?
Share
There’s actually a project out there which provides a Django middleware to do just this, called
django-axes. Simply install it with the instructions provided and then setAXES_LOGIN_FAILURE_LIMITto the number of login attempts you want before a record is created for the failed logins. You’ll still have to check this record when you want to lock someone out, however.