From e486664624421ee600a0a6288f529c889b7b91e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=BF=E5=B0=8F=E5=A4=A9?= <1638245306@qq.com> Date: Wed, 16 Nov 2022 23:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=8F=98=E5=8C=96:=20channel?= =?UTF-8?q?s=E6=94=B9=E5=86=85=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/application/settings.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/backend/application/settings.py b/backend/application/settings.py index 6112247..93e0127 100644 --- a/backend/application/settings.py +++ b/backend/application/settings.py @@ -170,13 +170,19 @@ CORS_ALLOW_CREDENTIALS = True # 指明在跨域访问中,后端是否支持 # ================================================= # ASGI_APPLICATION = 'application.routing.application' CHANNEL_LAYERS = { - 'default': { - 'BACKEND': 'channels_redis.core.RedisChannelLayer', - 'CONFIG': { - "hosts": [('127.0.0.1', 6379)], #需修改 - }, - }, + "default": { + "BACKEND": "channels.layers.InMemoryChannelLayer" + } } +# CHANNEL_LAYERS = { +# 'default': { +# 'BACKEND': 'channels_redis.core.RedisChannelLayer', +# 'CONFIG': { +# "hosts": [('127.0.0.1', 6379)], #需修改 +# }, +# }, +# } + # ================================================= # # ********************* 日志配置 ******************* #