phantasmobile/app/celery.py

17 lines
533 B
Python
Raw Normal View History

2023-07-24 11:05:45 +00:00
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
app = Celery('app', broker_connection_retry_on_startup=True)
2023-07-24 11:05:45 +00:00
# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
# should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings', namespace='CELERY')
# Load task modules from all registered Django app configs.
app.autodiscover_tasks()