ejemplo-de-chat-con-Django/mi_web/asgi.py
2020-11-17 23:42:59 +01:00

19 lines
442 B
Python

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