我正在使用 Django 频道创建一个 Django 私人聊天应用程序。我正面临 Redis 的问题。有人告诉我 Windows 操作系统不支持 Redis。任何人都可以有替代品吗?
settings.py 通道层
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("localhost", 6379)],
},
},
}
显示的错误是
connected {'type': 'websocket.connect'}
WebSocket CONNECT /chat/abdullah/ [127.0.0.1:55869]
Exception inside application: ERR unknown command 'EVAL'
File "C:\Users\Unknown\PycharmProjects\online_forum\venv\lib\site-packages\channels\sessions.py", line 183, in __call__
return await self.inner(receive, self.send)
File "C:\Users\Unknown\PycharmProjects\online_forum\venv\lib\site-packages\channels\middleware.py", line 41, in coroutine_call
await inner_instance(receive, send)
File "C:\Users\Unknown\PycharmProjects\online_forum\venv\lib\site-packages\channels\consumer.py", line 59, in __call__
[receive, self.channel_receive], self.dispatch
File "C:\Users\Unknown\PycharmProjects\online_forum\venv\lib\site-packages\channels\utils.py", line 59, in await_many_dispatch
await task
File "C:\Users\Unknown\PycharmProjects\online_forum\venv\lib\site-packages\channels\utils.py", line 51, in await_many_dispatch
result = task.result()
File "C:\Users\Unknown\PycharmProjects\online_forum\venv\lib\site-packages\channels_redis\core.py", line 429, in receive
real_channel
File "C:\Users\Unknown\PycharmProjects\online_forum\venv\lib\site-packages\channels_redis\core.py", line 484, in receive_single
index, channel_key, timeout=self.brpop_timeout
File "C:\Users\Unknown\PycharmProjects\online_forum\venv\lib\site-packages\channels_redis\core.py", line 327, in _brpop_with_clean
await connection.eval(cleanup_script, keys=[], args=[channel, backup_queue])
ERR unknown command 'EVAL'
WebSocket DISCONNECT /chat/abdullah/ [127.0.0.1:55869]
猛跑小猪
三国纷争
相关分类