From 63e571fb3846ca3d69958f65a59a0f856a051fb3 Mon Sep 17 00:00:00 2001 From: Mark Davidoff Date: Sat, 7 Apr 2018 11:50:16 -0700 Subject: [PATCH] updated docs --- docs/configuration.rst | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index b5ab87e..ef86b49 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -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 ----------------------------