[Python] How to get task_id inside the task function in django-q?

Discussão em 'Python' iniciado por Stack, Março 16, 2025.

  1. Stack

    Stack Membro Participativo

    I am using django-q for running background tasks in my django application. I am now in a scenario where I need to get the task_id inside the task function.

    A similar functionality in celery would look something like this: `

    @celery.task
    def scan(host):
    print scan.request.id


    `

    I searched online and could not find a solution. Any help would be appreciated.

    Continue reading...

Compartilhe esta Página