import os import django os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") django.setup() from channels.routing import ProtocolTypeRouter, URLRouter from django.core.asgi import get_asgi_application from django.urls import path from app.consumers import BenchmarkConsumer application = ProtocolTypeRouter( { "http": get_asgi_application(), "websocket": URLRouter( [path("ws/liveview//", BenchmarkConsumer.as_asgi())] ), } )