Skip to content
Myr

Update celery.rst

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by Afik · committed by Afik · parent afd3c45 · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:docs/patterns/celery.rst+3 added-3 removed
58 unmodified lines
59Flask::6061 from flask import Flask6263 app = Flask(__name__)64 app.config.update(63 flask_app = Flask(__name__)64 flask_app.config.update(65 CELERY_BROKER_URL='redis://localhost:6379',66 CELERY_RESULT_BACKEND='redis://localhost:6379'67 )68 celery = make_celery(app)68 celery = make_celery(flask_app)697071 @celery.task()72 def add_together(a, b):
20 unmodified lines