From 6c172fbaedcc40093db9874c067dd079678e4205 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 5 Apr 2024 13:24:26 +0300 Subject: Add explicit route for favicon to reduce noise in the logs. --- qc_app/entry.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'qc_app') diff --git a/qc_app/entry.py b/qc_app/entry.py index f166d4c..94bbd53 100644 --- a/qc_app/entry.py +++ b/qc_app/entry.py @@ -12,13 +12,22 @@ from flask import ( redirect, Blueprint, render_template, - current_app as app) + current_app as app, + send_from_directory) from qc_app.db import species from qc_app.db_utils import with_db_connection entrybp = Blueprint("entry", __name__) +@entrybp.route("/favicon.ico", methods=["GET"]) +def favicon(): + """Return the favicon.""" + return send_from_directory(os.path.join(app.root_path, "static"), + "images/CITGLogo.png", + mimetype="image/png") + + def errors(rqst) -> Tuple[str, ...]: """Return a tuple of the errors found in the request `rqst`. If no error is found, then an empty tuple is returned.""" -- cgit v1.2.3