将Django芹菜定期任务安排为不时运行

将Django芹菜定期任务安排为不时运行,django,cron,celery,django-celery,periodic-task,Django,Cron,Celery,Django Celery,Periodic Task,我如何才能完成运行Django芹菜任务,使其仅在周一至周五运行,而在这些天仅在美国东部时间上午9点至下午5点运行 芹菜.py from celery.schedule import crontab app.conf.beat_schedule = { 'compute-every-5-seconds': { 'task': 'sum', 'schedule': crontab(), }, } from celery.schedule

我如何才能完成运行Django芹菜任务,使其仅在周一至周五运行,而在这些天仅在美国东部时间上午9点至下午5点运行

芹菜.py

from celery.schedule import crontab


app.conf.beat_schedule = {
    'compute-every-5-seconds': {
         'task': 'sum',
         'schedule': crontab(),
     },
  }
from celery.schedule import crontab
app.conf.beat_schedule = {
    'compute-every-minute-mon-through-friday-9-to-5': {
         'task': 'sum',
         'schedule': crontab(minute='*/1',
hour='9-17', day_of_week='mon,tue,wed,thu,fri'),
     },
  }
我应该向crontab()添加哪些参数,以便它在这些天和这些小时之间运行?

芹菜.py

from celery.schedule import crontab


app.conf.beat_schedule = {
    'compute-every-5-seconds': {
         'task': 'sum',
         'schedule': crontab(),
     },
  }
from celery.schedule import crontab
app.conf.beat_schedule = {
    'compute-every-minute-mon-through-friday-9-to-5': {
         'task': 'sum',
         'schedule': crontab(minute='*/1',
hour='9-17', day_of_week='mon,tue,wed,thu,fri'),
     },
  }
minute='*/1'
-每分钟运行一次

hour='9-17'
-运行时间为上午9点至下午5点

day\u of u week='周一、周二、周三、周四、周五'
-周一至周五

其中大部分都可以在页面上找到,请查看