38 lines
909 B
Python
38 lines
909 B
Python
import secrets
|
|
|
|
from dotenv import load_dotenv
|
|
from pydantic import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# openssl rand -hex 32
|
|
SECRET_KEY: str = secrets.token_urlsafe(32)
|
|
MIDDLEWARE_SECRET_KEY: str = secrets.token_urlsafe(5)
|
|
ALGORITHM: str = "HS256"
|
|
JWT_TOKEN_EXPIRE_MINUTES: int = 30
|
|
NEW_DAY_OFFSET_MINUTES: int = 7 * 60
|
|
TIMEZONE_OFFSET_MINUTES: int = 330
|
|
HOST: str = "0.0.0.0"
|
|
PORT: int = 80
|
|
DEBUG: bool = False
|
|
LOG_LEVEL: str = "NOTSET"
|
|
SQLALCHEMY_DATABASE_URI: str = None
|
|
|
|
REDIS_HOST: str = "127.0.0.1"
|
|
REDIS_PORT: int = 6379
|
|
|
|
ALEMBIC_LOG_LEVEL: str = "INFO"
|
|
ALEMBIC_SQLALCHEMY_LOG_LEVEL: str = "WARN"
|
|
|
|
WORKER_REDIS_HOST: str = "127.0.0.1"
|
|
WORKER_REDIS_PORT: int = 6379
|
|
WORKER_QUEUE_NAME: str = "arq:queue"
|
|
|
|
class Config:
|
|
case_sensitive = True
|
|
env_file = ".env"
|
|
|
|
|
|
load_dotenv()
|
|
settings = Settings()
|