From 1c80777fe4a025834b47a614bb9f20a450d3080c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Sun, 10 Aug 2025 19:31:00 +0300 Subject: [PATCH] add config file --- app/__init__.py | 2 ++ app/templates/base.html | 4 ++-- app/templates/common/topnav.html | 2 +- config/pyrom_config.toml | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 config/pyrom_config.toml diff --git a/app/__init__.py b/app/__init__.py index f51d7e9..b487475 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -13,6 +13,7 @@ from datetime import datetime import os import time import secrets +import tomllib def create_default_avatar(): if Avatars.count() == 0: @@ -48,6 +49,7 @@ def create_deleted_user(): def create_app(): app = Flask(__name__) + app.config.from_file('../config/pyrom_config.toml', load=tomllib.load, text=False) if os.getenv("PYROM_PROD") is None: app.static_folder = os.path.join(os.path.dirname(__file__), "../data/static") diff --git a/app/templates/base.html b/app/templates/base.html index 3fc98e8..dbc1742 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -4,9 +4,9 @@ {% if self.title() %} - Porom - {% block title %}{% endblock %} + {{config.SITE_NAME}} - {% block title %}{% endblock %} {% else %} - Porom + {{config.SITE_NAME}} {% endif %} diff --git a/app/templates/common/topnav.html b/app/templates/common/topnav.html index 126f44f..95ac9c4 100644 --- a/app/templates/common/topnav.html +++ b/app/templates/common/topnav.html @@ -1,6 +1,6 @@