Skip to content

Instantly share code, notes, and snippets.

@igorkramaric
Created January 4, 2015 17:05
Show Gist options
  • Save igorkramaric/25baf6aa366b8f66698b to your computer and use it in GitHub Desktop.
Save igorkramaric/25baf6aa366b8f66698b to your computer and use it in GitHub Desktop.
import ujson
from kombu.serialization import kombu_register
kombu_register('ujson', ujson.dumps, ujson.loads,
content_type='application/x-ujson',
content_encoding='utf-8')
# Tell celery to use your ujson serializer:
CELERY_ACCEPT_CONTENT = ['ujson']
CELERY_TASK_SERIALIZER = 'ujson'
CELERY_RESULT_SERIALIZER = 'ujson'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment