5
我已經安裝Django的通道,但運行達芙妮服務器我得到這個錯誤,而如下:Django的通道錯誤 - 無法導入BACKEND「asgi_redis.RedisChannelLayer」
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
我的settings.py是:
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",
},
}
需要幫助來解決此錯誤。
仍然有效,帶有Channels 2.0 –