Skip to content Skip to sidebar Skip to footer

Django Celery Periodic Task At Specific Time

I am using celery==4.1.1 in my project. In my settings.py, I have the following: from celery.schedules import crontab CELERY_BROKER_URL = 'redis://127.0.0.1:6379/1' CELERY_TIMEZON

Solution 1:

'automatic_daily_report': {
            'task': 'tasks.daily_reports',
            'schedule': crontab(hour=0, minute=0),
            'args': None
        }


@shared_task()
def daily_reports():
    print("Mid- Night")

Above code worked for me.


Post a Comment for "Django Celery Periodic Task At Specific Time"