diff --git a/dash/backends/_fastapi.py b/dash/backends/_fastapi.py index 4e6266146f..4e5bdad621 100644 --- a/dash/backends/_fastapi.py +++ b/dash/backends/_fastapi.py @@ -188,6 +188,7 @@ async def _handle_error( async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: # Handle lifespan events (startup/shutdown) + if scope["type"] == "lifespan": try: dash_app = get_app() @@ -199,7 +200,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None: return # Non-HTTP/WebSocket scopes pass through - if scope["type"] not in ("http", "websocket"): + if scope["type"] != "http": await self.app(scope, receive, send) return @@ -298,7 +299,6 @@ def setup_catchall(self, dash_app: Dash): def _setup_catchall(self): try: - print("Setting up catch-all route for unmatched paths", file=sys.stderr) dash_app = get_app() async def catchall(_request: Request): @@ -317,10 +317,6 @@ def add_url_rule( methods: list[str] | None = None, include_in_schema: bool = False, ): - print( - f"Adding URL rule: {rule} -> {view_func} (endpoint: {endpoint}, methods: {methods})", - file=sys.stderr, - ) if rule == "": rule = "/" if isinstance(view_func, str): diff --git a/dash/dash.py b/dash/dash.py index d17c3c4e4e..ea53edf341 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -637,7 +637,6 @@ def __init__( # pylint: disable=too-many-statements, too-many-branches self._got_first_request = {"pages": False, "setup_server": False} if server: - print(f"init app from server {server}") self.init_app() self.logger.setLevel(logging.INFO)