35 lines
700 B
Python
35 lines
700 B
Python
import ssl
|
|
from pathlib import Path
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
S3_ACCESS_KEY: str
|
|
S3_SECRET_KEY: str
|
|
S3_BUCKET_NAME: str
|
|
S3_ENDPOINT_URL: str
|
|
S3_REGION_NAME: str
|
|
S3_SIGNATURE_VERSION: str
|
|
|
|
REDIS_HOST: str
|
|
REDIS_PORT: str
|
|
REDIS_PASSWORD: str
|
|
|
|
BASE_DIR: Path = Path(__file__).resolve().parent.parent.parent
|
|
|
|
model_config = SettingsConfigDict(env_file=BASE_DIR / ".env")
|
|
|
|
MEDIA_DIR: Path = BASE_DIR / "media"
|
|
|
|
|
|
settings = Settings()
|
|
|
|
|
|
REDIS_URL = (
|
|
f"redis://:{settings.REDIS_PASSWORD}@{settings.REDIS_HOST}:{settings.REDIS_PORT}"
|
|
)
|
|
|
|
|
|
ssl_options = {"ssl_cert_reqs": ssl.CERT_NONE}
|