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)]) - ) + ), } )