Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 53 for Maduin (0.17 sec)

  1. docs_src/bigger_applications/app_an_py39/internal/admin.py

    from fastapi import APIRouter
    
    router = APIRouter()
    
    
    @router.post("/")
    async def update_admin():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 147 bytes
    - Viewed (0)
  2. docs_src/bigger_applications/app_an/internal/admin.py

    from fastapi import APIRouter
    
    router = APIRouter()
    
    
    @router.post("/")
    async def update_admin():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 147 bytes
    - Viewed (0)
  3. tests/test_tutorial/test_settings/test_tutorial001_pv1.py

    @needs_pydanticv1
    def test_settings(monkeypatch: MonkeyPatch):
        monkeypatch.setenv("ADMIN_EMAIL", "admin@example.com")
        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() == {
            "app_name": "Awesome API",
            "admin_email": "admin@example.com",
            "items_per_user": 50,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 556 bytes
    - Viewed (0)
  4. docs_src/settings/app03_an/main.py

    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)
  5. tests/test_jsonable_encoder.py

    
    class Unserializable:
        def __iter__(self):
            raise NotImplementedError()
    
        @property
        def __dict__(self):
            raise NotImplementedError()
    
    
    class RoleEnum(Enum):
        admin = "admin"
        normal = "normal"
    
    
    class ModelWithConfig(BaseModel):
        role: Optional[RoleEnum] = None
    
        if PYDANTIC_V2:
            model_config = {"use_enum_values": True}
        else:
    
            class Config:
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  6. 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)
  7. docs/en/docs/advanced/settings.md

    {!../../../docs_src/settings/tutorial001.py!}
    ```
    
    ### Run the server
    
    Next, you would run the server passing the configurations as environment variables, for example you could set an `ADMIN_EMAIL` and `APP_NAME` with:
    
    <div class="termy">
    
    ```console
    $ ADMIN_EMAIL="******@****.***" APP_NAME="ChimichangApp" uvicorn main:app
    
    <span style="color: green;">INFO</span>:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
    ```
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 15.7K bytes
    - Viewed (0)
  8. docs/zh/docs/advanced/settings.md

    然后,您可以在应用程序中使用新的 `settings` 对象:
    
    ```Python hl_lines="18-20"
    {!../../../docs_src/settings/tutorial001.py!}
    ```
    
    ### 运行服务器
    
    接下来,您将运行服务器,并将配置作为环境变量传递。例如,您可以设置一个 `ADMIN_EMAIL` 和 `APP_NAME`,如下所示:
    
    <div class="termy">
    
    ```console
    $ ADMIN_EMAIL="******@****.***" APP_NAME="ChimichangApp"uvicorn main:app
    
    <span style="color: green;">INFO</span>:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
    ```
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 13.9K bytes
    - Viewed (0)
  9. docs_src/bigger_applications/app/internal/admin.py

    from fastapi import APIRouter
    
    router = APIRouter()
    
    
    @router.post("/")
    async def update_admin():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 29 17:32:18 GMT 2020
    - 147 bytes
    - Viewed (0)
  10. docs_src/settings/app02_an_py39/test_main.py

    client = TestClient(app)
    
    
    def get_settings_override():
        return Settings(admin_email="testing_admin@example.com")
    
    
    app.dependency_overrides[get_settings] = get_settings_override
    
    
    def test_app():
        response = client.get("/info")
        data = response.json()
        assert data == {
            "app_name": "Awesome API",
            "admin_email": "testing_admin@example.com",
            "items_per_user": 50,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 515 bytes
    - Viewed (0)
Back to top