text: """
  ASGI entrypoint. Configures Django and then runs the application
  defined in the ASGI_APPLICATION setting.
  """
  
  import os
  
  from channels.auth import AuthMiddlewareStack
  from channels.routing import ProtocolTypeRouter, URLRouter
  from django.core.asgi import get_asgi_application
  from channels.security.websocket import AllowedHostsOriginValidator
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openwisp.settings")
  django_asgi_app = get_asgi_application()
  
  from openwisp_controller.routing import get_routes  # noqa: E402
  
  application = ProtocolTypeRouter(
      {
          "http": django_asgi_app,
          "websocket": AllowedHostsOriginValidator(
              AuthMiddlewareStack(URLRouter(get_routes()))
          ),
      }
  )
  