Installing Celery for Django

Here’s a quick and rough guide on how to install Celery for Django on Ubuntu, aimed at refreshing the memory of those who’ve done it before.

  1. Install rabbitMQ (instructions here)

  2. Install Celery (detailed instructions here)

`easy_install django-celery

`

  1. On the console, type the following (change the infomation where needed, 123 is the password, vhost is the virtual host name):`

sudo rabbitmqctl add_user username 123

sudo rabbitmqctl add_vhost vhost

set_permissions -p vhost username “.” “.” “.*”

`

  1. Add the following to settings.py:

import djcelery

djcelery.setup_loader()

And to installed apps:

`‘djcelery’,

`and also

`BROKER_HOST = “localhost”

BROKER_PORT = 5672

BROKER_USER = “username”

BROKER_PASSWORD = “123”

BROKER_VHOST = “vhost”

`

  1. Run celeryd:

sudo python manage.py celeryd

Fork Herman Schaaf's IronZebra blog on GitHub

Herman Schaaf is a full-stack developer in Tokyo, Japan. He often works on language-related open source projects, and has recently developed a keen interest in Go. He's a friendly guy who sometimes talks about himself in third person. You can reach him at @ironzeb or via email. Or, read some more posts.