Skip to content

Commit ef76df6

Browse files
committed
fix import
1 parent 26231da commit ef76df6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pythonkr_backend/pythonkr_backend/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# This will make sure the app is always imported when
22
# Django starts so that shared_task will use this app.
3-
from django.conf import settings
3+
import os
44

5-
# load when PROD environment
6-
if settings.CELERY_ALWAYS_EAGER is False:
5+
DJANGO_SETTINGS_MODULE=os.environ.get("DJANGO_SETTINGS_MODULE")
6+
7+
if "prod" in DJANGO_SETTINGS_MODULE:
78
from .celery import app as celery_app
89
__all__ = ('celery_app',)
910
else:

0 commit comments

Comments
 (0)