Django Celery - Cannot connect to amqp://[email protected]:5672//
The problem is that you are trying to connect to a local instance of RabbitMQ. Look at this line in your settings.py
BROKER_URL = 'amqp://guest:guest@localhost:5672/'
If you are working currently on development, you could avoid setting up Rabbit and all the mess around it, and just use a development version of a message queue with the Django database.
Do this by replacing your previous configuration with:
BROKER_URL = 'django://'
...and add this app:
INSTALLED_APPS += ('kombu.transport.django', )
Finally, launch the worker with:
./manage.py celery worker --loglevel=info
Source: http://docs.celeryproject.org/en/latest/getting-started/brokers/django.html
I got this error because rabbitmq
was not started. If you installed rabbitmq
via brew you can start it using brew services start rabbitmq
If you are workling on a production environment,
You have to first install and setup a rabbitmq server. You can refer rabbitmq website for installation steps.
In settings you have to write this lines:
CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend',
BROKER_URL = 'amqp://guest:guest@localhost:5672//'
After all setup of rabitmq server you have to run this two command,
export C_FORCE_ROOT='true'
celery -A transcoder(name of app) worker --loglevel=info