diff --git a/backend/application/__init__.py b/backend/application/__init__.py index e69de29..b7ddb6f 100644 --- a/backend/application/__init__.py +++ b/backend/application/__init__.py @@ -0,0 +1,5 @@ +# 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 + +__all__ = ('celery_app',) \ No newline at end of file diff --git a/backend/application/celery.py b/backend/application/celery.py index d57b92a..10bce56 100644 --- a/backend/application/celery.py +++ b/backend/application/celery.py @@ -15,7 +15,7 @@ else: from celery import Celery app = Celery(f"application") -app.config_from_object('django.conf:settings') +app.config_from_object('django.conf:settings', namespace='CELERY') app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) platforms.C_FORCE_ROOT = True