can I use django-crontab to run periodic task

Hi readers I build a Django web application that fetches data from Microsoft graph API and I am using celery to run periodic tasks automatically but I want to use a cronjob to fetch data . so please suggest to me when to use cronjob and when celery I am a little bit confused about both functionality

I’d say the difference depends upon scheduling.

If it’s something to be run at a fixed time at fixed intervals, I would start by recommending cron.

If it’s something that is going to be run “on demand” as the result of some event happening on the site, then I would recommend Celery.

However, if you’ve got a mix of both, I would tend to recommend using Celery with Celery Beats to provide the scheduled operations, if only to minimize the number of different ways things are being run.

1 Like