From 3451c451bb5ee253a16f4109d68f9f2a298fa009 Mon Sep 17 00:00:00 2001 From: joshuastegmaier Date: Fri, 17 Nov 2023 13:26:43 -0500 Subject: [PATCH] Added Django handler to daphne config --- concordia/routing.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/concordia/routing.py b/concordia/routing.py index 824030052..88c47cf4d 100644 --- a/concordia/routing.py +++ b/concordia/routing.py @@ -1,14 +1,20 @@ +import os + from channels.auth import AuthMiddlewareStack from channels.routing import ProtocolTypeRouter, URLRouter +from django.core.asgi import get_asgi_application from django.urls import path from . import consumers +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "concordia.settings") +django_asgi_app = get_asgi_application() + application = ProtocolTypeRouter( { - # (http->django views is added by default) + "http": django_asgi_app, "websocket": AuthMiddlewareStack( URLRouter([path("ws/asset/asset_updates/", consumers.AssetConsumer)]) - ) + ), } )