File: views.py

package info (click to toggle)
celery-progress 0.1.1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 156 kB
  • sloc: python: 272; javascript: 168; makefile: 6
file content (10 lines) | stat: -rw-r--r-- 372 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
import json
from django.http import HttpResponse
from celery.result import AsyncResult
from celery_progress.backend import Progress
from django.views.decorators.cache import never_cache

@never_cache
def get_progress(request, task_id):
    progress = Progress(AsyncResult(task_id))
    return HttpResponse(json.dumps(progress.get_info()), content_type='application/json')