mirror of
https://github.com/FunnyWolf/agentic-soc-platform.git
synced 2026-08-22 13:12:56 +02:00
30 lines
825 B
Python
30 lines
825 B
Python
"""
|
|
ASGI config for asp project.
|
|
"""
|
|
|
|
import os
|
|
|
|
from django.conf import settings
|
|
from django.core.asgi import get_asgi_application
|
|
from django.contrib.staticfiles.handlers import ASGIStaticFilesHandler
|
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
|
|
|
from apps.common.logging import configure_process_file_logging
|
|
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "asp.settings")
|
|
|
|
django_application = get_asgi_application()
|
|
configure_process_file_logging("asgi")
|
|
|
|
from apps.realtime.auth import JWTAuthMiddleware # noqa: E402
|
|
from apps.realtime.routing import websocket_urlpatterns # noqa: E402
|
|
|
|
|
|
application = ProtocolTypeRouter({
|
|
"http": django_application,
|
|
"websocket": JWTAuthMiddleware(URLRouter(websocket_urlpatterns)),
|
|
})
|
|
|
|
if settings.DEBUG:
|
|
application = ASGIStaticFilesHandler(application)
|