We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fc21b6 commit 935b143Copy full SHA for 935b143
server/portal/asgi.py
@@ -5,12 +5,19 @@
5
6
import os
7
import django
8
-from channels.routing import ProtocolTypeRouter
+from channels.routing import ProtocolTypeRouter, URLRouter
9
from django.core.asgi import get_asgi_application
10
+from channels.auth import AuthMiddlewareStack
11
+import portal.apps.notifications.routing
12
13
14
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portal.settings.settings')
15
django.setup()
16
application = ProtocolTypeRouter({
17
"http": get_asgi_application(),
18
+ "websocket": AuthMiddlewareStack(
19
+ URLRouter(
20
+ portal.apps.notifications.routing.websocket_urlpatterns
21
+ )
22
23
})
server/portal/routing.py
0 commit comments