I am creating a reporting portal using django. On this portal, I need to give users the ability to schedule reports to run on a repeated basis. I am learning django-celery and understand that you can use the period_task decorator to schedule a repeat task, but in all the examples I saw, the cron schedule information is hard-coded in the decorator.
@periodic_task(run_every=crontab(hours=7, minute=30, day_of_week="mon"))
Is there a way to use django-celery to schedule a dynamic task dynamically based on user input?
For example, the user uses the form to select the report that they want to run, provide all the parameters necessary for the report and schedule when they want the report to work. Once I have processed the form, is there a method or function that I can call to add the run_report task to the schedule? If there is a way to retrieve all the current schedules stored in the database so that they can be displayed?
django celery user-input django-celery
user1042361
source share