Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
allgo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
110
Issues
110
List
Boards
Labels
Service Desk
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
allgo
allgo
Commits
e714a4e6
Commit
e714a4e6
authored
Mar 04, 2019
by
sebastien letort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API metrics auto-documentation with sphinx.
parent
cfc59d11
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
5 deletions
+80
-5
django/Dockerfile
django/Dockerfile
+3
-0
django/allgo/api/v1/__init__.py
django/allgo/api/v1/__init__.py
+8
-0
django/docs/conf.py
django/docs/conf.py
+4
-5
django/docs/dev/api.rst
django/docs/dev/api.rst
+15
-0
django/docs/dev/mixins.rst
django/docs/dev/mixins.rst
+35
-0
django/docs/index.rst
django/docs/index.rst
+15
-0
No files found.
django/Dockerfile
View file @
e714a4e6
...
...
@@ -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/generate_models_png.sh
python3-django-extensions python3-pydotplus
...
...
django/allgo/api/v1/__init__.py
View file @
e714a4e6
"""
.. automodule:: api.v1.metrics
:members:
.. automodule:: api.v1.mixins
:members:
.. automodule:: api.v1.views
:members:
"""
django/docs/conf.py
View file @
e714a4e6
...
...
@@ -19,10 +19,12 @@
#
import
os
import
sys
from
django.conf
import
settings
import
django
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'..'
))
settings
.
configure
()
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'../allgo'
))
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
'config.settings'
django
.
setup
()
# -- General configuration ------------------------------------------------
...
...
@@ -172,6 +174,3 @@ texinfo_documents = [
author
,
'Allgo'
,
'One line description of project.'
,
'Miscellaneous'
),
]
django/docs/dev/api.rst
0 → 100644
View file @
e714a4e6
.. _dev-doc:
metrics.py
==========
.. automodule:: api.v1.metrics
:members:
Accessories
===========
The metrics function are accessed through django Metrics view.
.. autoclass:: api.v1.views.Metrics
:members:
django/docs/dev/mixins.rst
0 → 100644
View file @
e714a4e6
.. _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 <https://docs.djangoproject.com/en/2.1/topics/auth/default/>`_
LoginRequiredMixin
prepend your code with
``if not request.user.is_authenticated: redirect/render``
It is used for website views accessible only for logged in users.
UserPassesTestMixin
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
:members:
AllGo Api mixin
----------------
.. automodule:: api.v1.mixins
:members:
django/docs/index.rst
View file @
e714a4e6
...
...
@@ -13,6 +13,21 @@ applications. This documentation is related to its front-end. Please see the
readme
installation
Developer docs
--------------
api
.. toctree::
dev/api
mixin
.. toctree::
mixins <dev/mixins>
Additional Notes
----------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment