Skip to content

Commit

Permalink
doc: cookbook: document workaround for celery (#197)
Browse files Browse the repository at this point in the history
See #196
  • Loading branch information
gthieleb authored and blueyed committed Jul 11, 2018
1 parent ee43a1d commit 2b0d2ce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 2b0d2ce

Please sign in to comment.