21 lines
592 B
Python
21 lines
592 B
Python
import os
|
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eusrr_backend.settings")
|
|
|
|
from django.core.asgi import get_asgi_application
|
|
django_asgi_app = get_asgi_application()
|
|
|
|
from channels.auth import AuthMiddlewareStack
|
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
|
from communications.routing import websocket_urlpatterns
|
|
from eusrr_backend.channels_jwt import JWTAuthMiddleware
|
|
|
|
|
|
|
|
application = ProtocolTypeRouter({
|
|
"http": django_asgi_app,
|
|
"websocket": JWTAuthMiddleware(
|
|
AuthMiddlewareStack(
|
|
URLRouter(websocket_urlpatterns)
|
|
)
|
|
),
|
|
}) |