mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-05-02 20:54:46 +00:00
Merge 07fecd7ad2 into d66ecc6d6e
This commit is contained in:
commit
5d6ba906dc
2 changed files with 6 additions and 4 deletions
4
configurations/autosetup.py
Normal file
4
configurations/autosetup.py
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
"""A module to automatically import and call :func:`setup()`."""
|
||||
from . import setup
|
||||
|
||||
setup()
|
||||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Reference in a new issue