ejemplo-de-chat-con-Django/asgi.py

19 lines
442 B
Python
Raw Normal View History

2020-11-15 10:52:18 +01:00
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)),
}
)