mirror of
https://github.com/barkeser2002/offline-db.git
synced 2026-09-25 02:19:59 +03:00
In `aniscrap_core/asgi.py`, the `URLRouter` only included `routing.websocket_urlpatterns` and `ws/chat/`. It was missing the `ws/notifications/` route for the `NotificationConsumer`. This PR fixes this issue by adding the route in `aniscrap_core/asgi.py`. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
"""
|
|
ASGI config for AniScrap project.
|
|
"""
|
|
|
|
import os
|
|
from django.core.asgi import get_asgi_application
|
|
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "aniscrap_core.settings")
|
|
|
|
# Initialize Django ASGI application early to ensure the AppRegistry
|
|
# is populated before importing code that may import ORM models.
|
|
django_asgi_app = get_asgi_application()
|
|
|
|
from channels.auth import AuthMiddlewareStack
|
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
|
from django.urls import path
|
|
from core.consumers import ChatConsumer
|
|
from users.consumers import NotificationConsumer
|
|
from apps.watchparty.consumers import WatchPartyConsumer
|
|
|
|
from apps.watchparty import routing
|
|
|
|
application = ProtocolTypeRouter({
|
|
"http": django_asgi_app,
|
|
"websocket": AuthMiddlewareStack(
|
|
URLRouter(
|
|
routing.websocket_urlpatterns + [
|
|
path("ws/chat/<str:room_name>/", ChatConsumer.as_asgi()), # Keeping legacy chat for now if needed, or remove?
|
|
path("ws/notifications/", NotificationConsumer.as_asgi()),
|
|
# Better to keep existing routes to avoid breaking other parts if any.
|
|
# However, the user asked for apps/watchparty as "The" module.
|
|
]
|
|
)
|
|
),
|
|
})
|