matthewwithanm / django-imagekit

Automated image processing for Django. Currently v4.0
http://django-imagekit.rtfd.org/
BSD 3-Clause "New" or "Revised" License
2.26k stars 276 forks source link

Celery 5.x not supported: TypeError: 'module' object is not callable #513

Closed jnns closed 3 years ago

jnns commented 3 years ago

An API that has been deprecated since Celery 4.0.0 has been removed in Celery 5.0.0. The preferred way is this:

Quote from Celery 5 documentation:

How do I import the task decorator? And what’s “app”?

The task decorator is available on your Celery application instance, if you don’t know what this is then please read First Steps with Celery.

If you’re using Django (see First steps with Django), or you’re the author of a library then you probably want to use the shared_task() decorator:

from celery import shared_task

@shared_task
def add(x, y):
    return x + y

Currently, django-imagekit tries to import celery.task which still works fine, but it doesn't do what it does previously.

vstoykov commented 3 years ago

Thank you for your report.

If you have time to prepare a PR I'll be very glad.

riazanovslv commented 3 years ago

I've prepared a PR to add the support for celery 5.^ Could you please have a look when you have a chance.

518

vstoykov commented 3 years ago

Fixed in #519