From 94ad7c9f133d30d9bec3f217c93d3d959943d773 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Wed, 20 Nov 2013 13:09:00 +0200 Subject: Bump to Celery 3.1.4 Add configuration changes that disable pickle as an accepted serializer Use the json serializer by default Required before bumping to Celery 3.2 --- tasks.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tasks.py') diff --git a/tasks.py b/tasks.py index c08c357..fa6b143 100644 --- a/tasks.py +++ b/tasks.py @@ -9,7 +9,14 @@ from os import environ REDIS_URL = environ.get('REDISTOGO_URL', 'redis://localhost') # Setup the celery instance under the 'tasks' namespace -celery = Celery('tasks', broker=REDIS_URL) +app = Celery('tasks') + +# Use Redis as our broker and define json as the default serializer +app.conf.update( + BROKER_URL=REDIS_URL, + CELERY_TASK_SERIALIZER='json', + CELERY_ACCEPT_CONTENT=['json', 'msgpack', 'yaml'] +) # Define the fibonacci function for use in our task def fib(n): -- cgit v1.3.1