From 06b8325cd82708ac07228c64596ad08878587089 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Tue, 19 Nov 2024 12:16:26 +0300 Subject: [PATCH] locale --- app/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/main.py b/app/main.py index 6d04757..e7c970a 100644 --- a/app/main.py +++ b/app/main.py @@ -13,7 +13,10 @@ from app.constants import * app = FastAPI() templates = Jinja2Templates(directory="templates") -locale.setlocale(locale.LC_TIME, 'ru_RU') +try: + locale.setlocale(locale.LC_TIME, 'ru_RU') +except Exception as e: + logger.error(e) # Создаем кастомный фильтр для форматирования дат def format_datetime(value, format="%d %B %Y, %H:%M:%S"):