Files
boss_dp/server/asgi.py

21 lines
553 B
Python
Raw Permalink Normal View History

2026-02-14 16:50:02 +08:00
# -*- coding: utf-8 -*-
"""
ASGI 入口HTTP (Django) + WebSocket (Channels)
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "server.settings")
import django # noqa: E402
django.setup() # noqa: E402
from channels.routing import ProtocolTypeRouter, URLRouter # noqa: E402
from django.core.asgi import get_asgi_application # noqa: E402
from server.ws.routing import websocket_urlpatterns # noqa: E402
application = ProtocolTypeRouter({
"http": get_asgi_application(),
"websocket": URLRouter(websocket_urlpatterns),
})