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.
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 toshared_task
instead of justtask
.Additionally, you can't pass a class through your queserver to a Celery process, so passing
sender
blows up with anEncodeError
. The fix is to pass the class as a dotted string path and then import it on the other side.