I am trying to follow the tutorial on read the docs for Django Channels. In the settings.py
file I am trying to change the inmemory BACKEND to the redis backend with the following code:
CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgi_redis.RedisChannelLayer",
"CONFIG": {
"hosts": [("localhost", 6379)],
},
"ROUTING": "chan.routing.channel_routing",
},
}
However, the moment I do this, the console which is running the runserver
command shows the following error:
ConnectionError: Error 61 connecting to localhost:6379. Connection refused.
How can I fix this?
Please make sure if redis is installed on your system and it is running. To check if redis is running use
redis-cli
then it will take you to redis console, then if you type ping
it will return PONG
if redis is running or not.
If you don't have redis in your system, please visit Redis Quick Start.
For Mac OS X: Go to terminal and type brew install redis
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With