From 67c165bcbb4028bd8335342f230692100fcd9776 Mon Sep 17 00:00:00 2001 From: Afik Date: Mon, 16 Dec 2013 22:04:51 -0800 Subject: [PATCH] Update celery.rst With the latest version of Celery (3.1.6), following this tutorial produces the following error when attempting to start the celery worker: user_preload = tuple(self.app.user_options['preload'] or ()) AttributeError: 'Flask' object has no attribute 'user_options' Using `app` as the variable name here confuses celery. Renaming `app` to `flask_app` in the tutorial solves the issue and allows the celery worker to start successfully. --- docs/patterns/celery.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/patterns/celery.rst b/docs/patterns/celery.rst index c7cd3922..60d32418 100644 --- a/docs/patterns/celery.rst +++ b/docs/patterns/celery.rst @@ -60,12 +60,12 @@ Flask:: from flask import Flask - app = Flask(__name__) - app.config.update( + flask_app = Flask(__name__) + flask_app.config.update( CELERY_BROKER_URL='redis://localhost:6379', CELERY_RESULT_BACKEND='redis://localhost:6379' ) - celery = make_celery(app) + celery = make_celery(flask_app) @celery.task()