From 5386a4d62afd8bfb5557c18ac37dbcb1e74f1127 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Thu, 14 Jul 2016 00:15:49 -0700 Subject: [PATCH] Allow environment specification of Celery broker --- cesium_app/celery_app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cesium_app/celery_app.py b/cesium_app/celery_app.py index 97cee38..387a6ce 100644 --- a/cesium_app/celery_app.py +++ b/cesium_app/celery_app.py @@ -1,8 +1,12 @@ from celery import Celery from cesium.celery_app import celery_config +import os +CELERY_BROKER = os.environ.get( + 'CELERY_BROKER', celery_config['CELERY_BROKER']) + celery_config['CELERY_IMPORTS'].append('cesium_app.celery_tasks') #celery_config['CELERY_RESULT_DBURI'] = 'db+postgresql://cesium:cesium@localhost/cesium' #celery_config['CELERY_RESULT_BACKEND'] = 'db+postgresql://cesium:cesium@localhost/cesium' -app = Celery('cesium_app', broker=celery_config['CELERY_BROKER']) +app = Celery('cesium_app', broker=CELERY_BROKER) app.config_from_object(celery_config)