forked from mlevogiannis/demos-voting
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
settings.py,__init__.py: update celery configuration
- register 'custom-json' as kombu serializer - set 'custom-json' as the default celery serializer - fix the result backend configuration - import settings from django.conf (it allows using different settings modules) - celery 3.1.19 is NOT supported due to a bug in the redis backend (only affects UNIX-domain sockets, see: celery/celery#2903)
- Loading branch information
1 parent
5829deb
commit 8069315
Showing
2 changed files
with
14 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
# File: __init__.py | ||
|
||
from .settings import base | ||
from django.conf import settings | ||
|
||
if set(base.DEMOS_APPS).intersection(['ea', 'bds', 'abb']): | ||
from .settings.celeryapp import app as celery_app | ||
|
||
import json | ||
|
||
from functools import partial | ||
from kombu.serialization import register | ||
from demos.common.utils.json import CustomJSONEncoder | ||
|
||
register('custom-json', partial(json.dumps, cls=CustomJSONEncoder), \ | ||
json.loads, 'application/x-custom-json', 'utf-8') | ||
|
||
|
||
#eof |
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