DEV Community

msbala007
msbala007

Posted on • Edited on

1

Scheduling the task using Crontab in Django


Enter fullscreen mode Exit fullscreen mode

*Implementing schedule task *

Note!!!!
1.You can't test this locally in Windows.
2.Don't forget to create the env file.

step 1:

FIRST install the django-crontab

Image description

And the create a function what you want to run.

Image description

step 2:
Add it to your settings.py

Image description

If you want to change the time please check the (crontab guru ) website

example:

Image description

step 3
And finally run this command

 python manage.py crontab add
Enter fullscreen mode Exit fullscreen mode

Happy code

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more