Merge remote-tracking branch 'nagyv/patch-1'

Signed-off-by: Jannis Leidel <jannis@leidel.info>
This commit is contained in:
Jannis Leidel 2015-01-06 23:54:10 +01:00
commit f2a46fb009
2 changed files with 41 additions and 0 deletions

View file

@ -13,3 +13,14 @@ def load_ipython_extension(ipython):
from . import importer
importer.install()
def setup(app):
"""
The callback for Sphinx that acts as a Sphinx extension.
Add this to the ``extensions`` config variable in your ``conf.py``.
"""
from . import importer
importer.install()

View file

@ -212,3 +212,33 @@ As you can see django-configurations provides a helper module
``configurations.fastcgi`` that handles the setup of your configurations.
.. _runfcgi: https://docs.djangoproject.com/en/1.5/howto/deployment/fastcgi/
Sphinx
------
.. versionadded: 0.9
In case you would like to user the amazing `autodoc` feature of the
documentation tool `Sphinx <http://sphinx-doc.org/>`_, you need add
django-configurations to your ``extensions`` config variable and set
the environment variable accordingly:
.. code-block:: python
:emphasize-lines: 2-3, 12
# My custom Django environment variables
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
# ...
'configurations',
]
# ...