40👍
This is how I solved the problem:
I saw that one of my apps was missing __init__.py
, which caused problem with app.autodiscover_tasks(settings.INSTALLED_APPS)
I added the missing __init__.py
and celery worker started without any issues
4👍
This error is raised by the Celery autodiscover_tasks
when it cannot load one of your INSTALLED_APPS for some reason. In my case it was a directory with tasks.py
file but other app files (models.py
etc) missing because of an incomplete Git commit.
- Save Django Foreign Key
- What are the default URLs for Django's User Authentication system?
- Django – reverse query name clash
- Adding a "through" table to django field and migrating with South?
1👍
First problem – I believe the line should actually be
app.autodiscover_tasks(settings.INSTALLED_APPS)
Why did you use a lambda?
The second traceback – in miscellaneous/middleware.py
you are invoking a celery task that passes a wsgiref.util.FileWrapper
object – however you are using the JSON serializer which cannot serialize object instances – you’ll need to use the pickle serializer instead.
See the relevant section in the docs.
- Check request type in Django
- How to ignore certain Python errors from Sentry capture
- Django-rest-framework serializer different fields in multiple views