add config file

This commit is contained in:
2025-08-10 19:31:00 +03:00
parent 4c2877403d
commit 1c80777fe4
4 changed files with 6 additions and 3 deletions

View File

@ -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")

View File

@ -4,9 +4,9 @@
<head>
<meta charset="UTF-8">
{% if self.title() %}
<title>Porom - {% block title %}{% endblock %}</title>
<title>{{config.SITE_NAME}} - {% block title %}{% endblock %}</title>
{% else %}
<title>Porom</title>
<title>{{config.SITE_NAME}}</title>
{% endif %}
<link rel="stylesheet" href="{{ "/static/style.css" | cachebust }}">
<link rel="icon" type="image/png" href="/static/favicon.png">

View File

@ -1,6 +1,6 @@
<nav id="topnav">
<span>
<a class="site-title" href="{{url_for('topics.all_topics')}}">Porom</a>
<a class="site-title" href="{{url_for('topics.all_topics')}}">{{config.SITE_NAME}}</a>
</span>
<span>
{% if not is_logged_in() %}

1
config/pyrom_config.toml Normal file
View File

@ -0,0 +1 @@
SITE_NAME = "Porom"