Django Channels Error - Cannot import BACKEND 'asgi_redis.RedisChannelLayer'

Utkarsh Sinha picture Utkarsh Sinha · May 20, 2016 · Viewed 13.6k times · Source

I have installed Django-Channels but while running the daphne-server I am getting this error given below:

File "/usr/local/lib/python2.7/dist-packages/channels/asgi.py", line 36, in make_backend
"Cannot import BACKEND %r specified for %s" % (self.configs[name]['BACKEND'], name)

channels.asgi.InvalidChannelLayerError: Cannot import BACKEND 'asgi_redis.RedisChannelLayer' specified for default

My settings.py is:

CHANNEL_LAYERS = {
"default": {
    "BACKEND": "asgi_redis.RedisChannelLayer",
    "CONFIG": {
        "hosts": [os.environ.get('REDIS_URL', 'redis://X.X.X.X:6379')],
    },
    "ROUTING": "MyProject.routing.channel_routing",
},
}

Need help in resolving this error.

Answer

drulang picture drulang · Nov 30, 2018

In regard to Utkarsh's reply itt's been renamed to:

pip install channels_redis