Marco Zeisler ff4b3508d8 move template to ./template;
setup django middleware;
setup angular frontend;
wire django and angular together;
2020-11-17 19:34:25 +01:00

18 lines
534 B
Python

from django.conf.urls import url
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.sessions import SessionMiddlewareStack
from django.core.asgi import get_asgi_application
from .views.ws_api import CustomConsumer
application = ProtocolTypeRouter({
# Django's ASGI application to handle traditional HTTP requests
"http": get_asgi_application(),
# WebSocket send handler
"websocket": SessionMiddlewareStack(URLRouter([
url(r"^test-ws-endpoint/$", CustomConsumer.as_asgi()),
]))
})