我想用 celerybeat 从 Python 脚本启动一个 Django celery worker。在命令行上,我会这样做:
python manage.py celery worker --beat --schedule celerybeat-schedule.db
我从一个脚本中尝试了这个,但它抛出了一个异常:
from django.core.management import call_command
call_command("cerlery", "worker", "--beat", "--schedule", "celerybeat-schedule.db")