Celery config - json serialization by default (#1535)

* Use json serialization in celery by default

* Added myself to CONTRIBUTORS.rst
This commit is contained in:
adammsteele 2018-03-01 11:25:33 +00:00 committed by Nikita Shupeyko
parent f5341fcace
commit ed2204ecba
2 changed files with 6 additions and 0 deletions

View File

@ -44,6 +44,7 @@ Listed in alphabetical order.
Aaron Eikenberry `@aeikenberry`_ Aaron Eikenberry `@aeikenberry`_
Adam Bogdał `@bogdal`_ Adam Bogdał `@bogdal`_
Adam Dobrawy `@ad-m`_ Adam Dobrawy `@ad-m`_
Adam Steele `@adammsteele`
Agam Dua Agam Dua
Alberto Sanchez `@alb3rto`_ Alberto Sanchez `@alb3rto`_
Alex Tsai `@caffodian`_ Alex Tsai `@caffodian`_
@ -159,6 +160,7 @@ Listed in alphabetical order.
.. _@a7p: https://github.com/a7p .. _@a7p: https://github.com/a7p
.. _@ad-m: https://github.com/ad-m .. _@ad-m: https://github.com/ad-m
.. _@adammsteele: https://github.com/adammsteele
.. _@aeikenberry: https://github.com/aeikenberry .. _@aeikenberry: https://github.com/aeikenberry
.. _@alb3rto: https://github.com/alb3rto .. _@alb3rto: https://github.com/alb3rto
.. _@ameistad: https://github.com/ameistad .. _@ameistad: https://github.com/ameistad

View File

@ -274,6 +274,10 @@ if CELERY_BROKER_URL == 'django://':
CELERY_RESULT_BACKEND = 'redis://' CELERY_RESULT_BACKEND = 'redis://'
else: else:
CELERY_RESULT_BACKEND = CELERY_BROKER_URL CELERY_RESULT_BACKEND = CELERY_BROKER_URL
# default to json serialization only
CELERY_ACCEPT_CONTENT = ['json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
########## END CELERY ########## END CELERY
{% endif %} {% endif %}