We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26231da commit ef76df6Copy full SHA for ef76df6
pythonkr_backend/pythonkr_backend/__init__.py
@@ -1,9 +1,10 @@
1
# This will make sure the app is always imported when
2
# Django starts so that shared_task will use this app.
3
-from django.conf import settings
+import os
4
5
-# load when PROD environment
6
-if settings.CELERY_ALWAYS_EAGER is False:
+DJANGO_SETTINGS_MODULE=os.environ.get("DJANGO_SETTINGS_MODULE")
+
7
+if "prod" in DJANGO_SETTINGS_MODULE:
8
from .celery import app as celery_app
9
__all__ = ('celery_app',)
10
else:
0 commit comments