add documentation for gvaldap project code

This commit is contained in:
Jan Dittberner 2014-05-31 16:12:36 +02:00
parent d86ba33f21
commit 4f4247ea9d
10 changed files with 100 additions and 12 deletions

View file

@ -4,9 +4,64 @@ Code documentation
.. 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/
.. _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

View file

@ -0,0 +1,3 @@
"""
This is the gvaldap project module.
"""

View file

@ -1,3 +1,9 @@
"""
This module defines the Celery_ app for gvaldap.
.. _Celery: http://www.celeryproject.org/
"""
from __future__ import absolute_import
import os
@ -10,12 +16,8 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'gvaldap.settings.production')
#: The Celery application
app = Celery('gvaldap')
app.config_from_object('django.conf:settings')
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
@app.task(bind=True)
def debug_task(self):
print('Request: {0!r}'.format(self.request))

View file

@ -1 +1,3 @@
"""
This module contains settings for various environments.
"""

View file

@ -1,5 +1,9 @@
"""Common settings and globals."""
# -*- coding: utf-8 -*-
# pymode:lint_ignore=E501
"""
Common settings and globals.
"""
from os.path import abspath, basename, dirname, join, normpath
@ -12,7 +16,14 @@ from django.core.exceptions import ImproperlyConfigured
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:
return environ[setting]
except KeyError:

View file

@ -1,5 +1,8 @@
"""Development settings and globals."""
# pymode:lint_ignore=W0401,E501
"""
Development settings and globals based on :py:mod:`gvaldap.settings.base`.
"""
from __future__ import absolute_import

View file

@ -1,5 +1,8 @@
"""Production settings and globals."""
# pymode:lint_ignore=W0401,E501
"""
Production settings and globals based on :py:mod:`gvaldap.settings.base`.
"""
from __future__ import absolute_import

View file

@ -1,4 +1,8 @@
# pymode:lint_ignore=W0401
"""
Test settings based on :py:mod:`gvaldap.settings.base`.
"""
from __future__ import absolute_import
from .base import *

View file

@ -1,3 +1,8 @@
"""
This module defines the main URLConf for gvaldap.
"""
from django.conf.urls import patterns, include, url
from django.conf import settings

View file

@ -26,10 +26,10 @@ path.append(SITE_ROOT)
# os.environ["DJANGO_SETTINGS_MODULE"] = "jajaja.settings"
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
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# Apply WSGI middleware here.