Update django database automatically with schedule

I am working on a Django project to track my daily tasks. I hope my database can automatically create a new record as “unfinished” at midnight each day. How can I implement this feature in Django + React?

Answer

2 Options came to my mind:

1- Use management command and cron:

Read about management command in https://docs.djangoproject.com/en/3.2/howto/custom-management-commands/#howto-custom-management-commands :

python manage.py YOUR_COMMAND

Then use cron in linux for setting scheduled task

2- Use celery

Read docs for using: https://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html