Created
January 14, 2016 15:36
-
-
Save ma1onso/ba7204c2605f4d3325da to your computer and use it in GitHub Desktop.
Example for celery.py file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
from __future__ import absolute_import | |
import os | |
from django.conf import settings | |
from celery import Celery | |
# set the default Django settings module for the 'celery' program. | |
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project_name.settings') | |
app = Celery('project_name') | |
# Using a string here means the worker will not have to | |
# pickle the object when using Windows. | |
app.config_from_object('django.conf:settings') | |
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment