DEV Community

msbala007
msbala007

Posted on • Updated on

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)