django cron Job Functionality

35 views
Skip to first unread message

Eugene TUYIZERE

unread,
Jun 11, 2021, 8:04:54 AM6/11/21
to django...@googlegroups.com
Dear Team, 

In my application, I want a user to set for example a leave plan in the system and the system notify the user by email for example one day before the start leave date. At the same time the system disables the user in the system. Here I have a field is_active and I want the system to set it to False from the leave date to the end date. And also to set Ongoing status on the leave plan user list. I heard somewhere that Django Cron Job can do this but I never use it and I do not know how to use it in the application.
If someone has used  it for some time please I need help. 

Thank you

--
Eugene

Chetan Ganji

unread,
Jun 11, 2021, 10:10:27 AM6/11/21
to django...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABxpZHt2hqPgNU%2BvyDb8Eua%2B6_OMM8H6xsMzTgJ-73-0erfmKw%40mail.gmail.com.

Kelvin Sajere

unread,
Jun 11, 2021, 10:19:41 AM6/11/21
to django...@googlegroups.com

What I would do in such case, is to write a function somewhere that checks if a user applied for a leave, then check if the leave time is within a day, then do whatever you want, like setting is_active to False. Then set the cron job to run this function every day, every hour, or however you'd like.
--
KeLLs

Nikeet NA

unread,
Jun 12, 2021, 12:35:29 AM6/12/21
to Django users
You should use celery for running cron jobs.

Eugene TUYIZERE

unread,
Jun 12, 2021, 2:42:14 AM6/12/21
to django...@googlegroups.com
Thank you for recommendations,

Because I never use this Celery-beat, if possible you can give some sample for example for someone who used it before

thanks



--
TUYIZERE Eugene

Msc Degree in Mathematical Science

African Institute for Mathematical Sciences (AIMS Cameroon)
Crystal Garden-Lime, Cameroon


Bsc in Computer Science

UR-Nyagatare Campus

Email: eugene....@aims-cameroon.org
           eugenet...@gmail.com

Tel: (+250) 7 88 26 33 38, (+250) 7 22 26 33 38

Ayser shuhaib

unread,
Jun 12, 2021, 2:54:38 AM6/12/21
to django...@googlegroups.com
Watch this video on how to schedule a task or function in your Django project, I’m sure it will have the answer to your question:




Ayser shuhaib

unread,
Jun 12, 2021, 2:55:35 AM6/12/21
to django...@googlegroups.com

Ayser shuhaib

unread,
Jun 12, 2021, 2:56:35 AM6/12/21
to django...@googlegroups.com
Watch this video on how to schedule a task or function in your Django project, I’m sure it will have the answer to your question:

Lalit Suthar

unread,
Jun 12, 2021, 3:14:58 AM6/12/21
to django...@googlegroups.com

Eugene TUYIZERE

unread,
Jun 12, 2021, 3:15:09 AM6/12/21
to django...@googlegroups.com
Dear Ayser,

You may be sent the wrong video. The video you sent is unrelated. Please give me the correct one.

regards, 

Ayser shuhaib

unread,
Jun 12, 2021, 3:23:35 AM6/12/21
to django...@googlegroups.com
I’m sorry for that.
This is the video I meant to send you


Reply all
Reply to author
Forward
0 new messages