Commit e714a4e6 authored by sebastien letort's avatar sebastien letort

API metrics auto-documentation with sphinx.

parent cfc59d11
......@@ -11,6 +11,9 @@ RUN apt-getq update && apt-getq install \
python3-crypto python3-natsort python3-aiohttp python3-aioredis supervisor \
python3-ipy python3-django-taggit python3-iso8601 python3-robot-detection \
python3-sqlparse \
# documentation
python3-sphinx \
make \
# generate the DB schema with graph_models, cf docs/
python3-django-extensions python3-pydotplus
.. automodule:: api.v1.metrics
.. automodule:: api.v1.mixins
.. automodule:: api.v1.views
......@@ -19,10 +19,12 @@
import os
import sys
from django.conf import settings
import django
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath('../allgo'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings'
# -- General configuration ------------------------------------------------
......@@ -172,6 +174,3 @@ texinfo_documents = [
author, 'Allgo', 'One line description of project.',
.. _dev-doc:
.. automodule:: api.v1.metrics
The metrics function are accessed through django Metrics view.
.. autoclass:: api.v1.views.Metrics
.. _dev-mixins:
In Django, mixins are used to provide shared functionnality to view (almost like interface).
Django mixins used
(from django.contrib.auth.mixins), more infos on `mixin <>`_
prepend your code with
``if not request.user.is_authenticated: redirect/render``
It is used for website views accessible only for logged in users.
prepend your code with
``if not your_test_func: redirect/render``
It is used for website views accessible only for logged in users that pass the test.
The test usually checks some permissions.
AllGo main mixins
.. automodule:: main.mixins
AllGo Api mixin
.. automodule:: api.v1.mixins
......@@ -13,6 +13,21 @@ applications. This documentation is related to its front-end. Please see the
Developer docs
.. toctree::
.. toctree::
mixins <dev/mixins>
Additional Notes
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment