From aa3854a13f841a04d1277637cbcdfef1cb7bd5cb Mon Sep 17 00:00:00 2001 From: poduck Date: Fri, 28 Nov 2025 04:50:09 -0500 Subject: [PATCH] feat: Implement core support ticket system backend and WebSocket notifications --- smoothschedule/config/asgi.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 smoothschedule/config/asgi.py diff --git a/smoothschedule/config/asgi.py b/smoothschedule/config/asgi.py new file mode 100644 index 0000000..8785626 --- /dev/null +++ b/smoothschedule/config/asgi.py @@ -0,0 +1,26 @@ +import os + +from django.core.asgi import get_asgi_application + +# Fetch Django's ASGI application early to ensure the AppRegistry is populated +# before importing code that may import ORM models. +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") # Use local settings for ASGI +django_asgi_app = get_asgi_application() + +from channels.auth import AuthMiddlewareStack +from channels.routing import ProtocolTypeRouter, URLRouter + +from smoothschedule.tickets import routing as tickets_routing # Assuming we'll have tickets routing + + +application = ProtocolTypeRouter( + { + "http": django_asgi_app, + # Just HTTP for now. (We can add other protocols later.) + "websocket": AuthMiddlewareStack( + URLRouter( + tickets_routing.websocket_urlpatterns # Include ticket-specific WebSocket routes + ) + ), + } +) \ No newline at end of file