Search Options

Results per page
Sort
Preferred Languages
Advance

Results 881 - 890 of 1,977 for Fastapi (0.13 sec)

  1. docs_src/request_form_models/tutorial001_an.py

    from fastapi import FastAPI, Form
    from pydantic import BaseModel
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class FormData(BaseModel):
        username: str
        password: str
    
    
    @app.post("/login/")
    async def login(data: Annotated[FormData, Form()]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 05 15:16:50 UTC 2024
    - 278 bytes
    - Viewed (0)
  2. docs/zh/docs/deployment/versions.md

    添加测试后,你可以将 **FastAPI** 版本升级到更新版本,并通过运行测试来确保所有代码都能正常工作。
    
    如果一切正常,或者在进行必要的更改之后,并且所有测试都通过了,那么你可以将`fastapi`固定到新的版本。
    
    ## 关于Starlette
    
    你不应该固定`starlette`的版本。
    
    不同版本的 **FastAPI** 将使用特定的较新版本的 Starlette。
    
    因此,**FastAPI** 自己可以使用正确的 Starlette 版本。
    
    ## 关于 Pydantic
    
    Pydantic 包含针对 **FastAPI** 的测试及其自己的测试,因此 Pydantic 的新版本(`1.0.0`以上)始终与 FastAPI 兼容。
    
    你可以将 Pydantic 固定到适合你的`1.0.0`以上和`2.0.0`以下的任何版本。
    
    例如:
    
    ````txt
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Aug 06 04:48:30 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  3. docs_src/header_params/tutorial003_an.py

    from typing import List, Union
    
    from fastapi import FastAPI, Header
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(x_token: Annotated[Union[List[str], None], Header()] = None):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 269 bytes
    - Viewed (0)
  4. docs_src/query_params/tutorial006_py310.py

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    async def read_user_item(
        item_id: str, needy: str, skip: int = 0, limit: int | None = None
    ):
        item = {"item_id": item_id, "needy": needy, "skip": skip, "limit": limit}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 269 bytes
    - Viewed (0)
  5. docs/de/docs/tutorial/static-files.md

    ```Python hl_lines="2  6"
    {!../../docs_src/static_files/tutorial001.py!}
    ```
    
    /// note | "Technische Details"
    
    Sie könnten auch `from starlette.staticfiles import StaticFiles` verwenden.
    
    **FastAPI** stellt dasselbe `starlette.staticfiles` auch via `fastapi.staticfiles` bereit, als Annehmlichkeit für Sie, den Entwickler. Es kommt aber tatsächlich direkt von Starlette.
    
    ///
    
    ### Was ist „Mounten“?
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  6. docs_src/query_params_str_validations/tutorial006_an_py39.py

    from typing import Annotated
    
    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str, Query(min_length=3)]):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 294 bytes
    - Viewed (0)
  7. docs_src/query_params_str_validations/tutorial006d_an.py

    from fastapi import FastAPI, Query
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: Annotated[str, Query(min_length=3)] = ...):
        results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]}
        if q:
            results.update({"q": q})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:36:32 UTC 2024
    - 310 bytes
    - Viewed (0)
  8. docs/en/docs/how-to/extending-openapi.md

    ### Normal **FastAPI**
    
    First, write all your **FastAPI** application as normally:
    
    {* ../../docs_src/extending_openapi/tutorial001.py hl[1,4,7:9] *}
    
    ### Generate the OpenAPI schema
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 22:39:38 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  9. tests/test_filter_pydantic_sub_model/test_filter_pydantic_sub_model_pv1.py

    import pytest
    from fastapi.exceptions import ResponseValidationError
    from fastapi.testclient import TestClient
    
    from ..utils import needs_pydanticv1
    
    
    @pytest.fixture(name="client")
    def get_client():
        from .app_pv1 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv1
    def test_filter_sub_model(client: TestClient):
        response = client.get("/model/modelA")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  10. docs_src/handling_errors/tutorial001.py

    from fastapi import FastAPI, HTTPException
    
    app = FastAPI()
    
    items = {"foo": "The Foo Wrestlers"}
    
    
    @app.get("/items/{item_id}")
    async def read_item(item_id: str):
        if item_id not in items:
            raise HTTPException(status_code=404, detail="Item not found")
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 299 bytes
    - Viewed (0)
Back to top