老师我的私信出问题了,不能立刻接收需要刷新,点赞和发表动态正常,这是咋回事儿啊
来源:10-12 一个隐藏的bug, github也有?
yu444913387
2020-01-31
# _*_coding:utf-8_*_
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator
from django.urls import path
from zanhu.messager.consumers import MessagesConsumer
from zanhu.notifications.consumers import NotificationsConsumer
application = ProtocolTypeRouter({
'websocket': AllowedHostsOriginValidator(
AuthMiddlewareStack(
URLRouter([
path('ws/notifications/', NotificationsConsumer),
path('ws/<str:username>/', MessagesConsumer),
])
)
)
})
写回答
1回答
-
yu444913387
提问者
2020-01-31
搞定了,staticfiles里 代码有问题,之前 static和staticfiles写反了,改过来之后代码是旧的
10
相似问题