2019-02-25 20:35:44 +00:00
|
|
|
.. _usage:
|
|
|
|
|
|
2019-04-27 13:06:47 +00:00
|
|
|
3. Usage
|
|
|
|
|
========
|
2019-02-03 00:57:20 +00:00
|
|
|
|
2019-02-25 14:59:44 +00:00
|
|
|
Once Axes is is installed and configured, you can login and logout
|
|
|
|
|
of your application via the ``django.contrib.auth`` views.
|
|
|
|
|
The attempts will be logged and visible in the Access Attempts section in admin.
|
2019-02-03 00:57:20 +00:00
|
|
|
|
2019-02-07 16:25:42 +00:00
|
|
|
By default, Axes will lock out repeated access attempts from the same IP address.
|
2019-02-25 14:59:44 +00:00
|
|
|
You can allow this IP to attempt again by deleting relevant AccessAttempt records.
|
2016-07-31 22:17:34 +00:00
|
|
|
|
2019-02-03 00:57:20 +00:00
|
|
|
Records can be deleted, for example, by using the Django admin application.
|
2016-07-31 22:17:34 +00:00
|
|
|
|
2019-02-25 14:59:44 +00:00
|
|
|
You can also use the ``axes_reset``, ``axes_reset_ip``, and ``axes_reset_username``
|
2019-02-03 00:57:20 +00:00
|
|
|
management commands with the Django ``manage.py`` command helpers:
|
2016-07-31 22:17:34 +00:00
|
|
|
|
2019-02-25 14:59:44 +00:00
|
|
|
- ``python manage.py axes_reset``
|
|
|
|
|
will reset all lockouts and access records.
|
2019-04-27 13:36:53 +00:00
|
|
|
- ``python manage.py axes_reset_ip [ip ...]``
|
2019-02-03 00:57:20 +00:00
|
|
|
will clear lockouts and records for the given IP addresses.
|
2019-04-27 13:36:53 +00:00
|
|
|
- ``python manage.py axes_reset_username [username ...]``
|
2019-02-03 00:57:20 +00:00
|
|
|
will clear lockouts and records for the given usernames.
|
2016-07-31 22:17:34 +00:00
|
|
|
|
2019-02-25 20:54:40 +00:00
|
|
|
In your code, you can use the ``axes.utils.reset`` function.
|
2018-12-22 18:44:44 +00:00
|
|
|
|
2019-02-25 14:59:44 +00:00
|
|
|
- ``reset()`` will reset all lockouts and access records.
|
|
|
|
|
- ``reset(ip=ip)`` will clear lockouts and records for the given IP address.
|
2019-02-25 20:35:44 +00:00
|
|
|
- ``reset(username=username)`` will clear lockouts and records for the given username.
|
2019-02-26 11:04:56 +00:00
|
|
|
|
|
|
|
|
Please note that if you give both ``username`` and ``ip`` arguments to ``reset``
|
|
|
|
|
that attempts that have both the set IP and username are reset.
|
|
|
|
|
|
|
|
|
|
The effective behaviour of ``reset`` is to ``and`` the terms instead of ``or``ing them.
|