Skip to content
 
 

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Celery Progress

Django Celery Progress is an app which provides a reusable way to track the progress of Celery tasks, and render a live progress bar on any page.

Requirements

  • Django
  • Celery

Installation

Install via pip:

pip install django-celery-progress

Usage

Call set_progress() from within a Celery task:

from celery_progress import backend

@app.task(bind=True)
def test_task(self):
    for i in range(100):
        time.sleep(random.uniform(0, 1))
        backend.set_progress(self.request.id, i)
    return 'done'

Show an automatically updating progress bar with the progress_bar template tag:

{% load celery_progress_tags %}

<script type="text/javascript" src='{% static "celery_progress/js/jquery-2.0.3.min.js" %}'></script>
<script type="text/javascript" src='{% static "celery_progress/js/update.js" %}'></script>

{% progress_bar 'test_task' task_id %}

<script type='text/javascript'>
    trackProgress('test_task', function taskDone(result) {
        alert('Done! Result: ' + result);
    });
</script>
Add celery_progress to your installed application in your settings:
INSTALLED_APPS = (
... 'celery_progress', ...

)

About

Track the progress of Celery tasks in Django.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages