demo-HTML-over-WebSockets-i.../mi_web/asgi.py
2021-03-07 18:15:29 +01:00

19 lines
442 B
Python

import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mi_web.settings")
import django
django.setup()
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
from apps.chat.routing import websocket_urlpatterns
application = ProtocolTypeRouter(
{
"websocket": AuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
}
)