EdulabBackend / routing.py
rinogeek's picture
Initial commit: EduLab Backend for Hugging Face Spaces
d42510a
# ============================================
# educonnect_api/routing.py - WebSockets (Channels)
# ============================================
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from django.urls import path
from apps.messaging.consumers import ChatConsumer
websocket_urlpatterns = [
path('ws/chat/<int:conversation_id>/', ChatConsumer.as_asgi()),
]
application = ProtocolTypeRouter({
'websocket': AuthMiddlewareStack(
URLRouter(websocket_urlpatterns)
),
})