Change celery tasks to shared task decorator

This commit is contained in:
Basraah
2017-12-11 00:26:07 +10:00
parent 676e68a2bb
commit f037d7fea6
14 changed files with 46 additions and 43 deletions

View File

@@ -0,0 +1,3 @@
from .celery import app as celery_app
__all__ = ['celery_app']

16
tests/celery.py Normal file
View File

@@ -0,0 +1,16 @@
import os, sys
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
from django.conf import settings # noqa
app = Celery('devauth')
# Using a string here means the worker don't have to serialize
# the configuration object to child processes.
app.config_from_object('django.conf:settings')
# Load task modules from all registered Django app configs.
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)