- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 60 for settings (0.47 sec)
-
docs_src/settings/app03_an/main.py
from . import config app = FastAPI() @lru_cache def get_settings(): return config.Settings() @app.get("/info") async def info(settings: Annotated[config.Settings, Depends(get_settings)]): return { "app_name": settings.app_name, "admin_email": settings.admin_email, "items_per_user": settings.items_per_user,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 451 bytes - Viewed (0) -
docs_src/conditional_openapi/tutorial001.py
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 281 bytes - Viewed (0) -
docs_src/settings/app02/config.py
from pydantic_settings import BaseSettings class Settings(BaseSettings): app_name: str = "Awesome API" admin_email: str
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 159 bytes - Viewed (0) -
tests/test_tutorial/test_settings/test_tutorial001_pv1.py
from fastapi.testclient import TestClient from pytest import MonkeyPatch from ...utils import needs_pydanticv1 @needs_pydanticv1 def test_settings(monkeypatch: MonkeyPatch): monkeypatch.setenv("ADMIN_EMAIL", "******@****.***") from docs_src.settings.tutorial001_pv1 import app client = TestClient(app) response = client.get("/info") assert response.status_code == 200, response.text assert response.json() == {
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 556 bytes - Viewed (0) -
docs_src/settings/app03/main.py
from . import config app = FastAPI() @lru_cache def get_settings(): return config.Settings() @app.get("/info") async def info(settings: config.Settings = Depends(get_settings)): return { "app_name": settings.app_name, "admin_email": settings.admin_email, "items_per_user": settings.items_per_user,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 412 bytes - Viewed (0) -
docs_src/settings/tutorial001_pv1.py
from pydantic import BaseSettings class Settings(BaseSettings): app_name: str = "Awesome API" admin_email: str items_per_user: int = 50 settings = Settings() app = FastAPI() @app.get("/info") async def info(): return { "app_name": settings.app_name, "admin_email": settings.admin_email, "items_per_user": settings.items_per_user,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 410 bytes - Viewed (0) -
docs_src/settings/app01/config.py
from pydantic_settings import BaseSettings class Settings(BaseSettings): app_name: str = "Awesome API" admin_email: str items_per_user: int = 50
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Fri Jul 07 17:12:13 GMT 2023 - 183 bytes - Viewed (0) -
docs_src/settings/app01/main.py
from fastapi import FastAPI from .config import settings app = FastAPI() @app.get("/info") async def info(): return { "app_name": settings.app_name, "admin_email": settings.admin_email, "items_per_user": settings.items_per_user,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Thu Jul 29 09:26:07 GMT 2021 - 267 bytes - Viewed (0) -
docs_src/settings/app02/main.py
from fastapi import Depends, FastAPI from .config import Settings app = FastAPI() @lru_cache def get_settings(): return Settings() @app.get("/info") async def info(settings: Settings = Depends(get_settings)): return { "app_name": settings.app_name, "admin_email": settings.admin_email, "items_per_user": settings.items_per_user,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 406 bytes - Viewed (0) -
docs_src/settings/app02_an/main.py
from typing_extensions import Annotated from .config import Settings app = FastAPI() @lru_cache def get_settings(): return Settings() @app.get("/info") async def info(settings: Annotated[Settings, Depends(get_settings)]): return { "app_name": settings.app_name, "admin_email": settings.admin_email, "items_per_user": settings.items_per_user,
Python - Registered: Sun Apr 28 07:19:10 GMT 2024 - Last Modified: Tue Oct 24 20:26:06 GMT 2023 - 456 bytes - Viewed (0)