python-scripts/scripts/Chat-App/Chatapp/asgi.py

22 lines
502 B
Python
Raw Normal View History

ASGI_APPLICATION = 'ChatApp.asgi.application'
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ChatApp.settings')
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter , URLRouter
from chat import routing
application = ProtocolTypeRouter(
{
"http" : get_asgi_application() ,
"websocket" : AuthMiddlewareStack(
URLRouter(
routing.websocket_urlpatterns
)
)
}
)