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

前端 未结 6 1079
面向向阳花
面向向阳花 2021-01-11 12:22

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/chann         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-11 13:18

    Faced the similar issue. Solved it by installing channels_redis:

    pip install channels_redis
    

    Also using channel redis in setting too:

    CHANNEL_LAYERS = {
        'default': {
            'BACKEND': 'channels_redis.core.RedisChannelLayer',
            'CONFIG': {
                'hosts': [('localhost', 6379)],
            },
        },
        'ROUTING': 'ws.routing.application',
    }
    

提交回复
热议问题