Setup Queue in Django using Celery and RabbitMQ


I’m using Ubuntu for setup queue in Django using celery and rabbitmq. Go to console and we need to install rabbitmq at first:

1. RabbitMQ

1
2
3
4
wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc
sudo apt-get update
sudo apt-get install rabbitmq-server

To adjust system limits (in particular the number of open file handles), edit the file /etc/default/rabbitmq-server to invoke ulimit when the service is started, for example:

1
ulimit -n 1024

Will set the maximum number of file open handles for the service process to 1024 (the default).

Invoke rabbitmqctl stop to stop the server.
Invoke rabbitmqctl status to check whether it is running.

Some detail tutorial
http://docs.dotcloud.com/tutorials/python/django-celery/
https://github.com/ServiceStack/rabbitmq-windows

2. Django Celery

1
pip install django-celery

Then add “djcelery” in INSTALLED_APPS. Then do migration by :

1
python manage.py migrate djcelery

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.