-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c194f34
commit c820eff
Showing
3 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
from __future__ import absolute_import, unicode_literals | ||
|
||
import os | ||
from logging.config import dictConfig # noqa | ||
|
||
from celery import Celery | ||
from celery.signals import setup_logging | ||
from django.conf import settings | ||
from django_structlog.celery.steps import DjangoStructLogInitStep | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "studio.settings") | ||
|
||
app = Celery("studio") | ||
|
||
app.steps["worker"].add(DjangoStructLogInitStep) | ||
app.config_from_object("django.conf:settings", namespace="CELERY") | ||
|
||
|
||
@setup_logging.connect | ||
def config_loggers(*args, **kwargs): | ||
# noqa | ||
logger_config = settings.LOGGING | ||
dictConfig(logger_config) | ||
|
||
|
||
app.autodiscover_tasks() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters