我是 Django 频道的新手并遵循教程(https://channels.readthedocs.io/en/latest/tutorial/part_2.html)
由于 Redis 不支持 Windows 7,我从 ( https://github.com/dmajkic/redis/downloads )下载了 Redis 2.4 版
当我尝试从 Django shell 访问 Redis 时,我收到了主题中提到的错误。
$ python3 manage.py shell
>>> import channels.layers
>>> channel_layer = channels.layers.get_channel_layer()
>>> from asgiref.sync import async_to_sync
>>> async_to_sync(channel_layer.send)('test_channel', {'type': 'hello'})
>>> async_to_sync(channel_layer.receive)('test_channel') # ERROR OCCURED AFTER THIS STEP