Update
This commit is contained in:
parent
ab102881d0
commit
958b006cd2
|
@ -197,3 +197,4 @@ cython_debug/
|
|||
|
||||
poetry.lock
|
||||
datings.db
|
||||
.env.local
|
||||
|
|
|
@ -13,6 +13,22 @@ from .router import router as datings_router
|
|||
from .validity import is_valid_uuid
|
||||
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
OPENAPI_URL: str = "/openapi.json"
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=(".env", ".env.local", ".env.prod"),
|
||||
env_file_encoding="utf-8",
|
||||
case_sensitive=True
|
||||
)
|
||||
|
||||
|
||||
settings = Settings()
|
||||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
await create_tables()
|
||||
|
@ -23,8 +39,9 @@ async def lifespan(app: FastAPI):
|
|||
pass
|
||||
|
||||
|
||||
# app = FastAPI(lifespan=lifespan)
|
||||
app = FastAPI(lifespan=lifespan, docs_url=None, redoc_url=None, openapi_url=None)
|
||||
app = FastAPI(
|
||||
lifespan=lifespan, docs_url=None, redoc_url=None, openapi_url=settings.OPENAPI_URL
|
||||
)
|
||||
|
||||
templates = Jinja2Templates(directory="templates")
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ dependencies = [
|
|||
"idna (>=3.10,<4.0)",
|
||||
"sniffio (>=1.3.1,<2.0.0)",
|
||||
"jinja2 (>=3.1.6,<4.0.0)",
|
||||
"pydantic-settings (>=2.9.1,<3.0.0)",
|
||||
]
|
||||
package-mode = false
|
||||
|
||||
|
|
Loading…
Reference in New Issue