feat(core): configure Django/Channels/ASGI settings and URL routing

This commit is contained in:
2026-04-28 12:36:32 +02:00
parent 538e88fff3
commit 9295617d8e
4 changed files with 142 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import os
import django
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
django.setup()
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from chat.routing import websocket_urlpatterns
application = ProtocolTypeRouter({
'http': get_asgi_application(),
'websocket': AuthMiddlewareStack(
URLRouter(websocket_urlpatterns)
),
})