I am having trouble finding any example of setting a task_id with my own task_id

5 views
Skip to first unread message

inet....@gmail.com

unread,
Apr 10, 2019, 7:12:13 AM4/10/19
to Django users
def testview1(request):
    for i in xrange(0,1000):
        result = add.delay( i, 4,task_id = i)
        print result.task_id
        #i want to display here i value
    return HttpResponse("Done") 


@task()
def add(task_id, x, y):
    print add.task_id
    print str(x+y)
    return x + y
Reply all
Reply to author
Forward
0 new messages