Skip to content

Commit

Permalink
config celery 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jsatt committed May 31, 2015
1 parent 1a0f78a commit 0b74b6d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions base_app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from __future__ import absolute_import

# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app
17 changes: 17 additions & 0 deletions base_app/celery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from __future__ import absolute_import

import os

from celery import Celery

from django.conf import settings

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'base_app.settings')

app = Celery('base_app')

# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object(settings)
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

0 comments on commit 0b74b6d

Please sign in to comment.