# HG changeset patch # User Ludovic Chabant # Date 1443156101 25200 # Node ID 8fb643ea798294af0798c1c85a7f2300ec85ae39 # Parent 436f9b54d3e15a69313e6d10866f565b9d9ffd68 runtasks: Give more info if Celery is not installed. diff -r 436f9b54d3e1 -r 8fb643ea7982 wikked/tasks.py --- a/wikked/tasks.py Thu Sep 24 21:26:56 2015 -0700 +++ b/wikked/tasks.py Thu Sep 24 21:41:41 2015 -0700 @@ -1,11 +1,18 @@ import logging -from celery import Celery from wikked.wiki import Wiki, WikiParameters, BACKGROUND_CONTEXT logger = logging.getLogger(__name__) +try: + from celery import Celery +except ImportError: + logger.error("Celery is needed to run background tasks.") + logger.error("Install it with: pip install celery") + raise + + logger.debug("Creating Celery application...") celery_app = Celery('wikked', include=['wikked.tasks'])