我正在尝试在heroku上使用apscheduler定期运行自定义管理命令。当我为时钟旋转测功机时,出现此错误django.core.management.base.CommandError: Unknown command: 'CreateBoarsHeadList'
。我可以从CLI很好地运行命令,但是我不确定我的问题在这里。
clock.py
os.environ['DJANGO_SETTINGS_MODULE'] = 'coffee.settings'
from apscheduler.schedulers.blocking import BlockingScheduler
from django.core import management
from django.core.management import call_command
sched = BlockingScheduler()
@sched.scheduled_job('interval', minutes = 1)
def boarsheadjob():
management.call_command('CreateBoarsHeadList')
sched.start()
while True:
pass
procfile
web: gunicorn coffee.wsgi --log-file -
clock: python clock.py
让我知道您是否还需要其他帮助来理解问题。