This document describes an older version of Celery (2.5). For the latest stable version please go here.

Using MongoDB

Installation

For the MongoDB support you have to install additional dependencies. You can install both Celery and these dependencies in one go using either the celery-with-mongodb, or the django-celery-with-mongodb bundles:

$ pip install -U celery-with-mongodb

Configuration

Configuration is easy, set the transport, and configure the location of your MongoDB database:

BROKER_URL = "mongodb://localhost:27017/database_name"

Where the URL is in the format of:

mongodb://userid:password@hostname:port/database_name

The host name will default to localhost and the port to 27017, and so they are optional. userid and password are also optional, but needed if your MongoDB server requires authentication.

Results

If you also want to store the state and return values of tasks in MongoDB, you should see MongoDB backend settings.

Limitations

The mongodb message transport currently does not support:

  • Remote control commands (celeryctl, broadcast)

Previous topic

Using the Django Database

Next topic

Using CouchDB

This Page