From ec77002fa7b9b38acfc3e749745d4f669cc48810 Mon Sep 17 00:00:00 2001 From: Lorenzo Date: Sat, 2 Nov 2024 23:24:50 +0100 Subject: [PATCH] Examples use redirect Best practices: redirect(url_for()) in place of send_file --- examples/sqla/admin/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/sqla/admin/main.py b/examples/sqla/admin/main.py index d8a6a6300..bc12a4194 100644 --- a/examples/sqla/admin/main.py +++ b/examples/sqla/admin/main.py @@ -1,5 +1,5 @@ import flask_admin as admin -from flask import send_file +from flask import redirect, url_for from flask_admin.babel import gettext from flask_admin.base import MenuLink from flask_admin.contrib import sqla @@ -42,7 +42,7 @@ def index(): @app.route("/favicon.ico") def favicon(): - return send_file("static/favicon.ico") + return redirect(url_for("static", filename="/favicon.ico")) # Custom filter class