创建task.py文件以包括
from django_rq import job@job("high", timeout=600) # timeout is optionaldef your_func(): pass # do some logic然后在你的代码中
import django_rqfrom tasks import your_funcqueue = django_rq.get_queue('high')queue.enqueue(your_func, foo, bar=baz)


