This commit is contained in:
Daniel Hahler 2016-01-27 21:57:04 +00:00
commit 5d6ba906dc
2 changed files with 6 additions and 4 deletions

View file

@ -0,0 +1,4 @@
"""A module to automatically import and call :func:`setup()`."""
from . import setup
setup()

View file

@ -106,8 +106,7 @@ probably just add the following to the **beginning** of your settings module:
.. code-block:: python
import configurations
configurations.setup()
from configurations import autosetup
That has the same effect as using the ``manage.py`` or ``wsgi.py`` utilities.
This will also call ``django.setup()``.
@ -136,8 +135,7 @@ Celery's documentation`_:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
os.environ.setdefault('DJANGO_CONFIGURATION', 'MySiteConfiguration')
import configurations
configurations.setup()
from configurations import autosetup
app = Celery('mysite')
app.config_from_object('django.conf:settings')