I am doing this at present, although I have not updated celery for some time. I'm still on 2.0.0.
I did to create the celery_app directory in my pylons application. (therefore, in the same directory as data, controllers, etc.)
This directory contains my celeryconfig.py, tasks.py, and pylons_tasks.py.
pylons_tasks.py is just a file that initializes the pylons application, so I can load Pylons models, etc. to the celery tasks.py file. In this way, the pylons are initialized and then imports tasks.py.
Then, in celeryconfig, myapp.celery_app.pylons_tasks is set to CELERY_IMPORTS.
CELERY_IMPORTS = ("myapp.celery_app.pylons_tasks", )
Hope this helps.
source share