File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 11import os
22
3- from pydantic import PostgresDsn , RedisDsn , computed_field
3+ from pydantic import PostgresDsn , RedisDsn , computed_field , BaseModel
44from pydantic_core import MultiHostUrl
55from pydantic_settings import BaseSettings , SettingsConfigDict
66
77
8+ class SMTPConfig (BaseModel ):
9+ server : str = os .getenv ("EMAIL_HOST" , "smtp_server" )
10+ port : int = os .getenv ("EMAIL_PORT" , 587 )
11+ username : str = os .getenv ("EMAIL_HOST_USER" , "smtp_user" )
12+ password : str = os .getenv ("EMAIL_HOST_PASSWORD" , "smtp_password" )
13+
14+
815class Settings (BaseSettings ):
916 model_config = SettingsConfigDict (
1017 env_file = ".env" , env_ignore_empty = True , extra = "ignore"
1118 )
1219 jwt_algorithm : str = os .getenv ("JWT_ALGORITHM" )
1320 jwt_expire : int = os .getenv ("JWT_EXPIRE" )
1421
22+ smtp : SMTPConfig = SMTPConfig ()
23+
1524 REDIS_HOST : str
1625 REDIS_PORT : int
1726 REDIS_DB : str
You can’t perform that action at this time.
0 commit comments