12đź‘Ť
This might hopefully help someone.
I had modified my code and neglected to restart the celery worker.
Try restarting the celery workers
.
6đź‘Ť
The error is because CELERY_IMPORTS setting is not working properly into your etl/settings/base.py file.
So my suggestion is :
Remove the comma from
CELERY_IMPORTS = ('pipeline.tasks' , )
And if the issue still persists,then run this command :
celery -A pipeline.tasks worker --loglevel=DEBUG
One more thing, your tasks.py file needs to be in a Django app (that’s registered in settings.py) in order to be imported.So check this point also.Thanks.
- Django: why are Django model fields class attributes?
- How does use_for_related_fields work in Django?
- How to start a long-running process from a Django view?
- Using Django's built in web server in a production environment
2đź‘Ť
Relative imports and automatic name generation don’t go well together, so if you’re using relative imports you should set the name explicitly.
For example if the client imports the module “myapp.tasks” as “.tasks”, and the worker imports the module as “myapp.tasks”, the generated names won’t match and an NotRegistered
error will be raised by the worker.
http://docs.celeryproject.org/en/latest/userguide/tasks.html#task-naming-relative-imports
- Override existing django-admin command
- Django queryset exclude() with multiple related field clauses
- How to make Django's "DATETIME_FORMAT" active?
- Multiple User Types For Auth in Django
- Django: why are Django model fields class attributes?
1đź‘Ť
I had this issue recently. An import error was causing the task to not be registered correctly. It was failing silently, so I had no way knowing that the task registration failure was being caused by the import error. Hopefully this can help out someone who is stuck with tasks not registering in celery.
- Returning form errors for AJAX request in Django
- Decoder JPEG not available error when following Django photo app tutorial
- How to join two models in django-rest-framework