mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-05-15 02:54:58 +00:00
doc: cookbook: document workaround for celery (#197)
See https://github.com/jazzband/django-configurations/issues/196
This commit is contained in:
parent
ee43a1d872
commit
2b0d2cee0a
1 changed files with 5 additions and 2 deletions
|
|
@ -136,8 +136,11 @@ Celery's documentation`_:
|
|||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
|
||||
os.environ.setdefault('DJANGO_CONFIGURATION', 'MySiteConfiguration')
|
||||
|
||||
import configurations
|
||||
configurations.setup()
|
||||
# The extra check is necessary to not call django.setup() twice.
|
||||
from configurations import importer
|
||||
if not importer.installed:
|
||||
import configurations
|
||||
configurations.setup()
|
||||
|
||||
app = Celery('mysite')
|
||||
app.config_from_object('django.conf:settings')
|
||||
|
|
|
|||
Loading…
Reference in a new issue