# apps/message/routing.py from django.urls import re_path from apps.message.consumers import NotificationConsumer from apps.chat.consumers import ChatStreamConsumer # 直接导入已有的ChatStreamConsumer import logging websocket_urlpatterns = [ re_path(r'^ws/notifications/$', NotificationConsumer.as_asgi()), re_path(r'^ws/chat/stream/$', ChatStreamConsumer.as_asgi()), ]