Update celery.rst #931

Merged
merged 1 commit into from Feb 8, 2014

5 participants

@aphexcx

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.

@aphexcx aphexcx 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.
67c165b
@jaapz

I'm running into this problem now too, why does this even happen?

@artemiy-rodionov

I`ve just ran it successfully with command

celery -A app.celery worker
@jaapz

I ran that too, but then my tasks won't run, giving a KeyError.

@artemiy-rodionov

Try to add a name to a task e.g.

@celery.task(name='sum-of-two-numbers') 
@georgepsarakis

@aphexcx 👍 for the workaround.

@mitsuhiko mitsuhiko merged commit e95cef6 into pallets:master Feb 8, 2014

1 check failed

Details default The Travis CI build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment