When you set up your application:
CELERYBEAT_SCHEDULER='djcelery.schedulers.DatabaseScheduler'
celery beat checks the django PeriodicTask model to see which task should be performed.
You can add / modify / delete these tasks by changing it using the django model:
from djcelery.models import PeriodicTask, CrontabSchedule every_hours_crontab = CrontabSchedule(minute=0) every_hours_crontab.save() periodic_task = PeriodicTask( name='Call my task every hour', task='myproject.tasks.mytask', crontab=every_hours_crontab, args=json.dump([arg1, arg2]), kwargs=json.dump({'foo': 'bar'}) ) periodic_task.save()
You can also test various PeriodicTask configurations using the django admin panel:
http://localhost:8000/admin/djcelery/crontabschedule/add/
http://localhost:8000/admin/djcelery/periodictask/
daniula
source share