djangodjango-q

Django-q how to delete scheduled tasks


I'm using django-q to schedule monthly event for sending emails. After several testing runs, I realized that each time I execute the:

Schedule.objects.create(func='app.email.send_monthly_email',schedule_type=Schedule.MONTHLY,repeats=-1)

this schedule event is cached and it will run the next time I start qcluster. How to I delete all the scheduled tasks in django-q? Or how can I have a clean start every time I run qcluster?


Solution

  • You can open the database shell using

    python manage.py dbshell
    

    And then use an SQL command :

    DELETE FROM django_q_schedule
    

    Remember that this will delete All Scheduled Tasks