django-configurations/configurations/__init__.py
Jannis Leidel 4d35ad346c Call django.setup() for Sphinx, too.
This also adds a configurations.setup() analogue to django.setup().
2015-02-13 22:18:33 +01:00

38 lines
818 B
Python

# flake8: noqa
from .base import Settings, Configuration
from .decorators import pristinemethod
__version__ = '0.8'
__all__ = ['Configuration', 'pristinemethod', 'Settings']
def _setup():
from . import importer
importer.install()
# django >=1.7
try:
import django
django.setup()
except AttributeError:
pass
def load_ipython_extension(ipython):
"""
The `ipython` argument is the currently active `InteractiveShell`
instance, which can be used in any way. This allows you to register
new magics or aliases, for example.
"""
_setup()
def setup(app=None):
"""
The callback for Sphinx that acts as a Sphinx extension.
Add ``'configurations'`` to the ``extensions`` config variable
in your docs' ``conf.py``.
"""
_setup()