Skip to content

Commit 935b143

Browse files
authored
bug/django 4 webhook fix (#909)
* testing webhook fix * cleanup
1 parent 4fc21b6 commit 935b143

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

server/portal/asgi.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@
55

66
import os
77
import django
8-
from channels.routing import ProtocolTypeRouter
8+
from channels.routing import ProtocolTypeRouter, URLRouter
99
from django.core.asgi import get_asgi_application
10+
from channels.auth import AuthMiddlewareStack
11+
import portal.apps.notifications.routing
1012

1113

1214
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'portal.settings.settings')
1315
django.setup()
1416
application = ProtocolTypeRouter({
1517
"http": get_asgi_application(),
18+
"websocket": AuthMiddlewareStack(
19+
URLRouter(
20+
portal.apps.notifications.routing.websocket_urlpatterns
21+
)
22+
)
1623
})

server/portal/routing.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)