From c94d2a77db0102a7cf8ceec7804f366f180c373f Mon Sep 17 00:00:00 2001 From: David Lord Date: Sat, 29 Mar 2025 15:30:56 -0700 Subject: [PATCH] add endpoint name in favicon example --- docs/patterns/favicon.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/patterns/favicon.rst b/docs/patterns/favicon.rst index 21ea767f..b867854f 100644 --- a/docs/patterns/favicon.rst +++ b/docs/patterns/favicon.rst @@ -24,8 +24,11 @@ the root path of the domain you either need to configure the web server to serve the icon at the root or if you can't do that you're out of luck. If however your application is the root you can simply route a redirect:: - app.add_url_rule('/favicon.ico', - redirect_to=url_for('static', filename='favicon.ico')) + app.add_url_rule( + "/favicon.ico", + endpoint="favicon", + redirect_to=url_for("static", filename="favicon.ico"), + ) If you want to save the extra redirect request you can also write a view using :func:`~flask.send_from_directory`::