diff --git a/dta_service/dta_service/asgi.py b/dta_service/dta_service/asgi.py index 0cc66af..1fa107a 100644 --- a/dta_service/dta_service/asgi.py +++ b/dta_service/dta_service/asgi.py @@ -6,11 +6,19 @@ It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/5.2/howto/deployment/asgi/ """ - import os - from django.core.asgi import get_asgi_application +from channels.routing import ProtocolTypeRouter, URLRouter +from channels.auth import AuthMiddlewareStack +import core.routing -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dta_service.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings') -application = get_asgi_application() +application = ProtocolTypeRouter({ + "http": get_asgi_application(), + "websocket": AuthMiddlewareStack( + URLRouter( + core.routing.websocket_urlpatterns + ) + ), + })