From 41307e6c5599b837f6c04e2f39b076b7a4207314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksi=20H=C3=A4kli?= Date: Sat, 27 Apr 2019 16:34:12 +0300 Subject: [PATCH] Add API reference into docs --- docs/10_reference.rst | 30 ++++++++++++++++++++++++++++++ docs/conf.py | 10 ++++++++-- docs/index.rst | 1 + 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 docs/10_reference.rst diff --git a/docs/10_reference.rst b/docs/10_reference.rst new file mode 100644 index 0000000..d331874 --- /dev/null +++ b/docs/10_reference.rst @@ -0,0 +1,30 @@ +.. _reference: + +10. API reference +================= + +Axes offers extendable APIs that you can customize to your liking. + +You can specialize the following base classes or altenatively +implement your own classes based on the following base implementations. + + +AxesBackend +----------- + +.. automodule:: axes.backends + :members: + + +AxesHandler +--------------- + +.. automodule:: axes.handlers.base + :members: + + +AxesMiddleware +-------------- + +.. automodule:: axes.middleware + :members: diff --git a/docs/conf.py b/docs/conf.py index c68e9ca..b2799b3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,9 +6,15 @@ More information on the configuration options is available at: http://www.sphinx-doc.org/en/master/usage/configuration.html """ -import sphinx_rtd_theme +import os import axes +import django +import sphinx_rtd_theme + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'axes.tests.settings') +django.setup() + # -- Extra custom configuration ------------------------------------------ @@ -19,7 +25,7 @@ description = 'Keep track of failed login attempts in Django-powered sites.', # Add any Sphinx extension module names here, as strings. # They can be extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = [] +extensions = ['sphinx.ext.autodoc'] # Add any paths that contain templates here, relative to this directory. templates_path = [ diff --git a/docs/index.rst b/docs/index.rst index e012bbe..7383065 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,6 +18,7 @@ Contents 7_upgrading 8_development 9_architecture + 10_reference Indices and tables ------------------