mirror of
https://github.com/jazzband/django-axes.git
synced 2026-05-12 09:33:12 +00:00
updated docs
This commit is contained in:
parent
c8acf69eab
commit
63e571fb38
1 changed files with 23 additions and 2 deletions
|
|
@ -3,7 +3,9 @@
|
|||
Configuration
|
||||
=============
|
||||
|
||||
Just add `axes` to your ``INSTALLED_APPS``::
|
||||
3 Simple Steps!
|
||||
|
||||
- add `axes` to your ``INSTALLED_APPS``::
|
||||
|
||||
INSTALLED_APPS = (
|
||||
'django.contrib.admin',
|
||||
|
|
@ -16,7 +18,26 @@ Just add `axes` to your ``INSTALLED_APPS``::
|
|||
...
|
||||
)
|
||||
|
||||
Remember to run ``python manage.py migrate`` to sync the database.
|
||||
- add Axes to the top of ``AUTHENTICATION_BACKENDS``::
|
||||
|
||||
AUTHENTICATION_BACKENDS = [
|
||||
'axes.middleware.DjangoAxesAuthBackend',
|
||||
...
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
...
|
||||
]
|
||||
|
||||
- run ``python manage.py migrate`` to sync the database.
|
||||
|
||||
Things to you might need to change in your code, especially if you get a ``AxesModelBackend.RequestParameterRequired``:
|
||||
|
||||
- make sure any calls to ``django.contrib.auth.authenticate`` pass the request.
|
||||
|
||||
- make sure any auth libraries you use that call the authentication middleware stack pass request. Notably Django Rest
|
||||
Framework (DRF) ``BasicAuthentication`` does not pass request. `Here is an example workaround for DRF`_.
|
||||
|
||||
.. _Here is an example workaround for DRF: http://www.python.org
|
||||
|
||||
|
||||
Known configuration problems
|
||||
----------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue