Skip to content

Commit e1d95e4

Browse files
committed
better task discovery
1 parent 63ee989 commit e1d95e4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

backend/fpbase/celery.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import os
22

33
from celery import Celery
4-
5-
import proteins.tasks # noqa: F401
4+
from django.conf import settings
65

76
if "DJANGO_SETTINGS_MODULE" not in os.environ:
87
os.environ["DJANGO_SETTINGS_MODULE"] = "config.settings.local"
@@ -11,4 +10,4 @@
1110
app.config_from_object("django.conf:settings", namespace="CELERY")
1211

1312
# Load task modules from all registered Django app configs.
14-
app.autodiscover_tasks()
13+
app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)

0 commit comments

Comments
 (0)