You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromceleryimportCeleryapp=Celery('proj',
broker='amqp://',
backend='rpc://',
include=['proj.tasks'])
# Optional configuration, see the application user guide.app.conf.update(
result_expires=3600,
)
if__name__=='__main__':
app.start()
I cannot get this to work - how can you import Celery from the celery module in a file also called celery - won't that create a circular import?
Also the error from running celery -A proj worker -l INFO in the project root is
Error: Invalid value for'-A' / '--app':
Unable to load celery application.
Module 'proj.celery' has no attribute 'celery'
This implies that its expecting the Celery instance to be called celery not app I think. In either case the examples don't seem to work without modification.
I've been using celery in projects fine, but I had to follow third party tutorials - which used a different pattern (i.e. using celeryapp.py as the filename, and explicitly specifying the celery instance in the worker run command). I couldn't get started using the official guides though.
Suggestions
The text was updated successfully, but these errors were encountered:
Checklist
for similar or identical bug reports.
for existing proposed fixes.
to find out if the bug was already fixed in the main branch.
(If there are none, check this box anyway).
Related Issues and Possible Duplicates
Related Issues
Possible Duplicates
Description
getting-started/next-steps.html has an example as follows
Project Structure
celery.py
I cannot get this to work - how can you import
Celery
from thecelery
module in a file also calledcelery
- won't that create a circular import?Also the error from running
celery -A proj worker -l INFO
in the project root isThis implies that its expecting the
Celery
instance to be calledcelery
notapp
I think. In either case the examples don't seem to work without modification.I've been using celery in projects fine, but I had to follow third party tutorials - which used a different pattern (i.e. using
celeryapp.py
as the filename, and explicitly specifying the celery instance in the worker run command). I couldn't get started using the official guides though.Suggestions
The text was updated successfully, but these errors were encountered: