Django scheduled Tasks - Alternative to Cron or In

2020-04-20 08:19发布

问题:

In creating scheduled tasks I've used both Cron and a specially set up daemon for django.

Cron is silly-simple, and the daemon (in my opinion) might be excessive. The daemon set up an independent Django instance.

Django itself (If I'm not mistaken) runs as a daemon anyway, correct?

I'm wondering - how do you schedule tasks within the Django environment without leaving off from standard use?

回答1:

You can use Celery to run periodic tasks but depending on what are you trying to do it could be overkill.

If your use case it's simple, cron+management command it's way easier. You can use Kronos, django-cron or any of this libraries for this