feat: Implement core support ticket system backend and WebSocket notifications
This commit is contained in:
26
smoothschedule/config/asgi.py
Normal file
26
smoothschedule/config/asgi.py
Normal file
@@ -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
|
||||||
|
)
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user