demo-HTML-over-WebSockets-i.../my_demo/asgi.py

19 lines
443 B
Python
Raw Normal View History

2021-03-07 18:15:29 +01:00
import os
2021-03-08 21:25:34 +01:00
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_demo.settings")
2021-03-07 18:15:29 +01:00
import django
django.setup()
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
2021-03-08 21:25:34 +01:00
from apps.back.routing import websocket_urlpatterns
2021-03-07 18:15:29 +01:00
application = ProtocolTypeRouter(
{
"websocket": AuthMiddlewareStack(URLRouter(websocket_urlpatterns)),
}
)