diff --git a/site/app.py b/site/app.py index 302f679..1c6aed9 100644 --- a/site/app.py +++ b/site/app.py @@ -111,7 +111,10 @@ def index(): ) +# --- Инициализация БД при старте (до первого запроса) --- +with app.app_context(): + init_db() + + if __name__ == "__main__": - with app.app_context(): - init_db() app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)), debug=False)