Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions {{ cookiecutter.name }}/src/app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from app.celery import celery as celery_app


__all__ = ["celery_app"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На одном из последних проектов я делал ровно такой же фикс (единственно, вызов autodiscover_tasks не изменял). Удивляет, что до этого почему-то ни разу не сталкивался с этой проблемой.

3 changes: 1 addition & 2 deletions {{ cookiecutter.name }}/src/app/celery.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os

from celery import Celery
from django.conf import settings


__all__ = ["celery"]
Expand All @@ -10,6 +9,6 @@

celery = Celery("app")
celery.config_from_object("django.conf:settings", namespace="CELERY")
celery.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
celery.autodiscover_tasks()

celery.conf.beat_schedule = {}
Loading