How to customize lockout mechanism in Django Axes?

I am new to Django Axes. I need to customize the lockout of Django Axes so that the user is locked out when the number of login attempts reaches the AXES_FAILURE_LIMIT within a 10 minute period.

I tried creating a custom handler for the signal user_login_failed that:

  1. Gets the list of Access Attempts of the username
  2. Gets the time difference of the oldest and the latest login attempt
  3. If the login attempts count are less than or equal to the AXES_FAILURE_LIMIT, and if the time difference is more than 10 minutes, It will delete the oldest attempt to prevent the lockout. Else, it will continue the lockout process.

However, when the login attempt reaches the AXES_FAILURE_LIMIT, the user_login_failed signal is not triggered and the user is locked out.

Is there a better way to handle this? Is this just a configuration on Django Axes?

Back to Top