create mesh app and basic asgi websocket setup for communication

This commit is contained in:
Laura Klünder 2022-04-04 01:13:48 +02:00
parent f51bc71799
commit 8af6bca51c
10 changed files with 63 additions and 0 deletions

16
src/c3nav/asgi.py Normal file
View file

@ -0,0 +1,16 @@
import os
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
from c3nav.urls import websocket_urlpatterns
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
application = ProtocolTypeRouter({
"http": get_asgi_application(),
"websocket": AuthMiddlewareStack(
URLRouter(websocket_urlpatterns)
),
})