SmileyChris / easy-thumbnails

Easy thumbnails for Django
http://easy-thumbnails.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1.37k stars 312 forks source link

Fix Celery portion to not suffer an EncodeError: #553

Closed danielquinn closed 3 years ago

danielquinn commented 3 years ago

The current documentation makes reference to the now-dead django-celery package. Celery supports Django out-of-the-box, so there's no need to lean on another dependency. There's only one syntactic change: the switch to shared_task instead of just task.

Additionally, you can't pass a class through your queserver to a Celery process, so passing sender blows up with an EncodeError. The fix is to pass the class as a dotted string path and then import it on the other side.

jrief commented 3 years ago

Thanks!