Asynchronous Tasks in Django with Redis and Celery



In this tutorial I will be providing a general understanding of why celery message queue’s are valuable along with how to utilize celery in conjunction with Redis in a Django application. To demonstrate implementation specifics I will build a minimalistic image processing application that generates thumbnails of images submitted by users.

The following topics will be covered:

The code for this example can be found on GitHub along with installation and set up instructions if you just want to jump right into a functionally complete application, otherwise for the remainder of the article I will taking you through how to build everything from scratch.

Background on Message Queues with Celery and Redis

Celery is a Python based task queuing software package that enables execution of asynchronous computational workloads driven by information contained in messages that are produced in application code (Django in this example) destined for a Celery task queue. Celery can also be used to execute repeatable, period (ie, scheduled), tasks but, that will not be the focus of this article.

Celery is best used in conjunction with a storage solution that is often referred to as a message broker. A common

To finish reading, please visit source site