[Django]-Stop celery task from django admin panel

0👍

I couldn’t simulate your problem but can suggest two important points:

  1. Celery documentation says you should start celery with -A flag first.

    celery -A proj worker -l INFO

  2. In the documentation, every revoke() method called from app.control, not from celery library itself. So you should change this line:

celery.control.revoke(self.task_id, terminate=True, signal='SIGKILL')

to this line:

from proj.celery import app
app.control.revoke(self.task_id, terminate=True, signal='SIGKILL')

I hope this will solve your problem.

Leave a comment