first commit

This commit is contained in:
2026-06-19 13:38:17 +08:00
commit f38814e9bd
11 changed files with 915 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
model_config = {
"env_file": ".env",
"env_file_encoding": "utf-8",
"case_sensitive": False,
}
database_host: str = "localhost"
database_port: int = 5432
database_user: str = "postgres"
database_password: str = "postgres"
database_name: str = "weather_data"
@property
def database_url(self) -> str:
return (
f"postgresql://{self.database_user}:{self.database_password}"
f"@{self.database_host}:{self.database_port}/{self.database_name}"
)
settings = Settings()