2021-10-28 10:12:20 +00:00
|
|
|
"""
|
|
|
|
ASGI config for config project.
|
|
|
|
|
|
|
|
It exposes the ASGI callable as a module-level variable named ``application``.
|
|
|
|
|
|
|
|
For more information on this file, see
|
|
|
|
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
2022-06-21 19:54:17 +00:00
|
|
|
from channels.auth import AuthMiddlewareStack
|
|
|
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
2021-10-28 10:12:20 +00:00
|
|
|
from django.core.asgi import get_asgi_application
|
|
|
|
|
2022-06-21 19:54:17 +00:00
|
|
|
import websocket.routing
|
|
|
|
|
2021-10-28 10:12:20 +00:00
|
|
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
|
2022-05-20 17:14:48 +00:00
|
|
|
django_asgi_app = get_asgi_application()
|
2021-10-28 10:12:20 +00:00
|
|
|
|
2022-05-20 17:14:48 +00:00
|
|
|
#application = get_asgi_application()
|
|
|
|
application = ProtocolTypeRouter({
|
|
|
|
"http": django_asgi_app,
|
2022-06-21 19:54:17 +00:00
|
|
|
"websocket": AuthMiddlewareStack(
|
|
|
|
URLRouter(
|
|
|
|
websocket.routing.websocket_urlpatterns
|
|
|
|
)
|
|
|
|
),
|
2022-05-20 17:14:48 +00:00
|
|
|
})
|