Implement TimeZone in settings

This commit is contained in:
Sebastiaan
2025-06-16 11:31:35 +02:00
parent 7848578ebb
commit f2f0475859
2 changed files with 9 additions and 0 deletions

2
.env
View File

@@ -38,6 +38,8 @@ POSTGRES_DB=app
POSTGRES_USER=postgres
POSTGRES_PASSWORD=changethis
TZ=UTC
SENTRY_DSN=
# Configure these with your own Docker registry images

View File

@@ -14,6 +14,7 @@ from pydantic import (
from pydantic_core import MultiHostUrl
from pydantic_settings import BaseSettings, SettingsConfigDict
from typing_extensions import Self
from zoneinfo import ZoneInfo
def parse_cors(v: Any) -> list[str] | str:
@@ -69,6 +70,12 @@ class Settings(BaseSettings):
path=self.POSTGRES_DB,
)
tz: str = "UTC"
@property
def tz_info(self):
return ZoneInfo(self.tz)
SMTP_TLS: bool = True
SMTP_SSL: bool = False
SMTP_PORT: int = 587