James Reid
James Reid

Reputation: 459

Setting up broker url

I would like some help here. All I want is to add Celery and RabbitMQ to my django project. I followed this tutorial Celery - First Step with Django. and It was able to work. However how could I customize this setup?

CELERY_BROKER_URL = 'amqp://guest:guest@localhost:5672//'

How can I change guest as a real given userId and password? Where should I configure it like: amqp://userid:[email protected]:5672

Upvotes: 5

Views: 4829

Answers (1)

Nitheesh A S
Nitheesh A S

Reputation: 387

From the official documentation:

To use Celery we need to create a RabbitMQ user, a virtual host and allow that user access to that virtual host:

$ sudo rabbitmqctl add_user myuser mypassword
$ sudo rabbitmqctl add_vhost myvhost
$ sudo rabbitmqctl set_user_tags myuser mytag 
$ sudo rabbitmqctl set_permissions -p myvhost myuser ".*" ".*" ".*"

P.S. For virtual host, you can always just give / in place of myvhost if required.

Upvotes: 2

Related Questions