I'm programming an irrigation system with Django and I use Celery to handle asynchronous tasks.
In my application the user selects the days and hours that he wants to activate the irrigation, this is stored in the database and he can update them at any time.
I know I can schedule tasks like this, but I want to update the time.
from celery.task.schedules import crontab
from celery.decorators import periodic_task
@periodic_task(run_every=crontab(hour=7, minute=30, day_of_week="mon"))
def every_monday_morning():
print("This runs every Monday morning at 7:30a.m.")
Another way is to use python-crontab