Failed to load latest commit information.
demoapp Cosmetics Oct 31, 2016
proj Make __all__ immutable. (#4315) Oct 7, 2017
README.rst Fix typos (#4140) Jul 18, 2017 flakes Apr 2, 2016
requirements.txt Examples: Django: Unpin requirements Jul 20, 2016


Example Django project using Celery



This is a project in itself, created using startproject proj, and then the settings module (proj/ was modified to add demoapp to INSTALLED_APPS


This module contains the Celery application instance for this project, we take configuration from Django settings and use autodiscover_tasks to find task modules inside all packages listed in INSTALLED_APPS.


Example generic app. This is decoupled from the rest of the project by using the @shared_task decorator. This decorator returns a proxy that always points to the currently active Celery instance.

Installing requirements

The settings file assumes that rabbitmq-server is running on localhost using the default ports. More information here:

In addition, some Python requirements must also be satisfied:

$ pip install -r requirements.txt

Starting the worker

$ celery -A proj worker -l info

Running a task

$ python ./ shell
>>> from demoapp.tasks import add, mul, xsum
>>> res = add.delay(2,3)
>>> res.get()