I am able to run redis locally and everything works.
However when I deploy to heroku I get this error:
Error 111 connecting to localhost:6379. Conn
Error 111 is thrown when the application is unable to contact Redis. I had the same problem following the Heroku Django Channels tutorial. The settings.py file should read:
CHANNEL_LAYERS = {
"default": {
"BACKEND": "asgi_redis.RedisChannelLayer",
"CONFIG": {
"hosts": [os.environ.get('REDISCLOUD_URL', 'redis://localhost:6379')],
},
"ROUTING": "chat.routing.channel_routing",
},
}
REDISCLOUD_URL
instead of REDIS_URL
.
Ensure Redis is installed on the Heroku server.