Register Celery Class-based Task

后端 未结 2 729
慢半拍i
慢半拍i 2020-12-31 04:02

Python 3.x, Celery 4.x...

I have a class-based task.

myproj/celery.py

from celery import Celery

# django settings stuff...

app         


        
2条回答
  •  时光说笑
    2020-12-31 04:34

    You can find full description here, but for me it was enough to add

    from myapp.celery import app
    app.tasks.register(MyTaskTask())
    

提交回复
热议问题