Skip to content

Commit

Permalink
Added Django handler to daphne config
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuastegmaier authored and rasarkar committed Nov 17, 2023
1 parent 74205dd commit 3451c45
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions concordia/routing.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import os

from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
from django.urls import path

from . import consumers

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "concordia.settings")
django_asgi_app = get_asgi_application()

application = ProtocolTypeRouter(
{
# (http->django views is added by default)
"http": django_asgi_app,
"websocket": AuthMiddlewareStack(
URLRouter([path("ws/asset/asset_updates/", consumers.AssetConsumer)])
)
),
}
)

0 comments on commit 3451c45

Please sign in to comment.