问题
i try to execute background function using celery: this is my current code :
from VideoPublish.models import TitleVideo, Videos
from celery.decorators import task
from UploadExpert.celery import app
# Create your views here.
demo_titles =['title1', 'title2', 'title3']
@app.task(ignore_result=True)
def GetTitles(video_id):
video = Videos.objects.get(pk=video_id)
for title in demo_titles:
t = TitleVideo(
title=title,
video_id=video.id
)
t.save()
this is call function :
GetTitles.delay(video_id=obj.id)
and this is a celery error:
https://gist.github.com/scaltro/cc6152f82b0fbf501af396b8ad812e91
i want to know where i'am wrong, and how i can solve this problem
来源:https://stackoverflow.com/questions/53527918/django-2-1-celery-not-execute-asyncron-task