add documentation for gvaldap project code
This commit is contained in:
parent
d86ba33f21
commit
4f4247ea9d
10 changed files with 100 additions and 12 deletions
|
@ -4,9 +4,64 @@ Code documentation
|
||||||
|
|
||||||
.. index:: Django
|
.. index:: Django
|
||||||
|
|
||||||
gvaldap is implemented as a set of `Django`_ apps.
|
gvaldap is implemented as `Django`_ project and provides some `Celery`_ tasks.
|
||||||
|
|
||||||
.. _Django: https://www.djangoproject.com/
|
.. _Django: https://www.djangoproject.com/
|
||||||
|
.. _Celery: http://www.celeryproject.org/
|
||||||
|
|
||||||
|
|
||||||
|
The project module :py:mod:`gvaldap`
|
||||||
|
====================================
|
||||||
|
|
||||||
|
.. automodule:: gvaldap
|
||||||
|
|
||||||
|
|
||||||
|
:py:mod:`gvaldap.celery`
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
.. automodule:: gvaldap.celery
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
:py:mod:`gvaldap.urls`
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
.. automodule:: gvaldap.urls
|
||||||
|
|
||||||
|
|
||||||
|
:py:mod:`gvaldap.wsgi`
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
.. automodule:: gvaldap.wsgi
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
:py:mod:`gvaldap.settings`
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
.. automodule:: gvaldap.settings
|
||||||
|
|
||||||
|
:py:mod:`gvaldap.settings.base`
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. automodule:: gvaldap.settings.base
|
||||||
|
:members:
|
||||||
|
|
||||||
|
:py:mod:`gvaldap.settings.local`
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. automodule:: gvaldap.settings.local
|
||||||
|
|
||||||
|
:py:mod:`gvaldap.settings.production`
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. automodule:: gvaldap.settings.production
|
||||||
|
|
||||||
|
:py:mod:`gvaldap.settings.test`
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
.. automodule:: gvaldap.settings.test
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
:py:mod:`ldapentities` app
|
:py:mod:`ldapentities` app
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
"""
|
||||||
|
This is the gvaldap project module.
|
||||||
|
"""
|
|
@ -1,3 +1,9 @@
|
||||||
|
"""
|
||||||
|
This module defines the Celery_ app for gvaldap.
|
||||||
|
|
||||||
|
.. _Celery: http://www.celeryproject.org/
|
||||||
|
|
||||||
|
"""
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
@ -10,12 +16,8 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE',
|
||||||
'gvaldap.settings.production')
|
'gvaldap.settings.production')
|
||||||
|
|
||||||
|
|
||||||
|
#: The Celery application
|
||||||
app = Celery('gvaldap')
|
app = Celery('gvaldap')
|
||||||
|
|
||||||
app.config_from_object('django.conf:settings')
|
app.config_from_object('django.conf:settings')
|
||||||
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
|
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
|
||||||
|
|
||||||
|
|
||||||
@app.task(bind=True)
|
|
||||||
def debug_task(self):
|
|
||||||
print('Request: {0!r}'.format(self.request))
|
|
||||||
|
|
|
@ -1 +1,3 @@
|
||||||
|
"""
|
||||||
|
This module contains settings for various environments.
|
||||||
|
"""
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
"""Common settings and globals."""
|
# -*- coding: utf-8 -*-
|
||||||
# pymode:lint_ignore=E501
|
# pymode:lint_ignore=E501
|
||||||
|
"""
|
||||||
|
Common settings and globals.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
from os.path import abspath, basename, dirname, join, normpath
|
from os.path import abspath, basename, dirname, join, normpath
|
||||||
|
@ -12,7 +16,14 @@ from django.core.exceptions import ImproperlyConfigured
|
||||||
|
|
||||||
|
|
||||||
def get_env_setting(setting):
|
def get_env_setting(setting):
|
||||||
""" Get the environment setting or return exception """
|
"""
|
||||||
|
Get the environment setting or return exception.
|
||||||
|
|
||||||
|
:param str setting: name of an environment setting
|
||||||
|
:raises ImproperlyConfigured: if the environment setting is not defined
|
||||||
|
:return: environment setting value
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
return environ[setting]
|
return environ[setting]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
"""Development settings and globals."""
|
|
||||||
# pymode:lint_ignore=W0401,E501
|
# pymode:lint_ignore=W0401,E501
|
||||||
|
"""
|
||||||
|
Development settings and globals based on :py:mod:`gvaldap.settings.base`.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
"""Production settings and globals."""
|
|
||||||
# pymode:lint_ignore=W0401,E501
|
# pymode:lint_ignore=W0401,E501
|
||||||
|
"""
|
||||||
|
Production settings and globals based on :py:mod:`gvaldap.settings.base`.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
# pymode:lint_ignore=W0401
|
# pymode:lint_ignore=W0401
|
||||||
|
"""
|
||||||
|
Test settings based on :py:mod:`gvaldap.settings.base`.
|
||||||
|
|
||||||
|
"""
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from .base import *
|
from .base import *
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
"""
|
||||||
|
This module defines the main URLConf for gvaldap.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
from django.conf.urls import patterns, include, url
|
from django.conf.urls import patterns, include, url
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,10 @@ path.append(SITE_ROOT)
|
||||||
# os.environ["DJANGO_SETTINGS_MODULE"] = "jajaja.settings"
|
# os.environ["DJANGO_SETTINGS_MODULE"] = "jajaja.settings"
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gvaldap.settings.production")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gvaldap.settings.production")
|
||||||
|
|
||||||
|
from django.core.wsgi import get_wsgi_application
|
||||||
# This application object is used by any WSGI server configured to use this
|
# This application object is used by any WSGI server configured to use this
|
||||||
# file. This includes Django's development server, if the WSGI_APPLICATION
|
# file. This includes Django's development server, if the WSGI_APPLICATION
|
||||||
# setting points here.
|
# setting points here.
|
||||||
from django.core.wsgi import get_wsgi_application
|
|
||||||
application = get_wsgi_application()
|
application = get_wsgi_application()
|
||||||
|
|
||||||
# Apply WSGI middleware here.
|
# Apply WSGI middleware here.
|
||||||
|
|
Loading…
Reference in a new issue