From 0a563c0a1a092e91a2aae70d2734881d6bf3bcb4 Mon Sep 17 00:00:00 2001 From: RGalyaviev Date: Thu, 12 Feb 2026 23:05:38 +0300 Subject: [PATCH] fix: make favicon load consistently across all pages --- app.py | 11 ++++++++++- templates/admin_login.html | 2 ++ templates/admin_settings.html | 2 ++ templates/base.html | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index aa6dfd2..6ae1d15 100644 --- a/app.py +++ b/app.py @@ -7,7 +7,7 @@ from functools import wraps from pathlib import Path from urllib import parse, request as urllib_request -from flask import Flask, redirect, render_template, request, session, url_for +from flask import Flask, redirect, render_template, request, send_from_directory, session, url_for from werkzeug.security import check_password_hash @@ -250,6 +250,15 @@ def health(): return {"status": "error"}, 503 +@app.route("/favicon.ico") +def favicon(): + return send_from_directory( + app.static_folder, + "img/favicon.png", + mimetype="image/png", + ) + + if __name__ == "__main__": init_db() app.run(debug=True) diff --git a/templates/admin_login.html b/templates/admin_login.html index d22c9ad..799e0bd 100644 --- a/templates/admin_login.html +++ b/templates/admin_login.html @@ -4,6 +4,8 @@ Вход в админку | InfraIT + + diff --git a/templates/admin_settings.html b/templates/admin_settings.html index 7714a29..de84a22 100644 --- a/templates/admin_settings.html +++ b/templates/admin_settings.html @@ -4,6 +4,8 @@ Настройки сайта | InfraIT + + diff --git a/templates/base.html b/templates/base.html index 82ec249..7ee7c33 100644 --- a/templates/base.html +++ b/templates/base.html @@ -12,6 +12,7 @@ + {% if settings.yandex_metrika_id %}