Skip to content

Commit

Permalink
Examples use redirect
Browse files Browse the repository at this point in the history
Best practices: redirect(url_for()) in place of send_file
  • Loading branch information
ElLorans authored Nov 2, 2024
1 parent 11bc145 commit ec77002
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/sqla/admin/main.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ec77002

Please sign in to comment.