Search Options

Results per page
Sort
Preferred Languages
Advance

Results 791 - 800 of 890 for docs_src (0.05 sec)

  1. tests/test_tutorial/test_response_model/test_tutorial003.py

    from dirty_equals import IsDict, IsOneOf
    from fastapi.testclient import TestClient
    
    from docs_src.response_model.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_post_user():
        response = client.post(
            "/user/",
            json={
                "username": "foo",
                "password": "fighter",
                "email": "******@****.***",
                "full_name": "Grave Dohl",
            },
        )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 04 20:47:07 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_response_model/test_tutorial004_py39.py

    import pytest
    from dirty_equals import IsDict, IsOneOf
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py39
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.response_model.tutorial004_py39 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_py39
    @pytest.mark.parametrize(
        "url,data",
        [
            ("/items/foo", {"name": "Foo", "price": 50.2}),
            (
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 04 20:47:07 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_extra_models/test_tutorial003.py

    from dirty_equals import IsOneOf
    from fastapi.testclient import TestClient
    
    from docs_src.extra_models.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_get_car():
        response = client.get("/items/item1")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "description": "All my friends drive a low rider",
            "type": "car",
        }
    
    
    def test_get_plane():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Aug 04 20:47:07 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  4. docs/em/docs/tutorial/cors.md

    ๐Ÿ‘† ๐Ÿ’ช โœ” ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ‘ฉโ€๐Ÿ’ป โœ”:
    
    * ๐ŸŽ“ (โœ” ๐ŸŽš, ๐Ÿช, โ™’๏ธ).
    * ๐ŸŽฏ ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ” ๐Ÿ‘ฉโ€๐Ÿ”ฌ (`POST`, `PUT`) โš–๏ธ ๐ŸŒ ๐Ÿ‘ซ โฎ๏ธ ๐Ÿƒ `"*"`.
    * ๐ŸŽฏ ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ” ๐ŸŽš โš–๏ธ ๐ŸŒ ๐Ÿ‘ซ โฎ๏ธ ๐Ÿƒ `"*"`.
    
    ```Python hl_lines="2  6-11  13-19"
    {!../../docs_src/cors/tutorial001.py!}
    ```
    
    ๐Ÿ”ข ๐Ÿ”ข โš™๏ธ `CORSMiddleware` ๐Ÿ› ๏ธ ๐Ÿšซ ๐Ÿ”ข, ๐Ÿ‘† ๐Ÿ”œ ๐Ÿ’ช ๐ŸŽฏ ๐Ÿ› ๏ธ ๐ŸŽฏ ๐Ÿ‡จ๐Ÿ‡ณ, ๐Ÿ‘ฉโ€๐Ÿ”ฌ, โš–๏ธ ๐ŸŽš, โœ” ๐Ÿ–ฅ โœ” โš™๏ธ ๐Ÿ‘ซ โœ–๏ธ-๐Ÿ†” ๐Ÿ”‘.
    
    ๐Ÿ“„ โŒ ๐Ÿ•โ€๐Ÿฆบ:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/static-files.md

    # ์ •์  ํŒŒ์ผ
    
    'StaticFiles'๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ์ •์  ํŒŒ์ผ์„ ์ž๋™์œผ๋กœ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    
    ## `StaticFiles` ์‚ฌ์šฉ
    
    * `StaticFiles` ์ž„ํฌํŠธํ•ฉ๋‹ˆ๋‹ค.
    * ํŠน์ • ๊ฒฝ๋กœ์— `StaticFiles()` ์ธ์Šคํ„ด์Šค๋ฅผ "๋งˆ์šดํŠธ" ํ•ฉ๋‹ˆ๋‹ค.
    
    ```Python hl_lines="2  6"
    {!../../docs_src/static_files/tutorial001.py!}
    ```
    
    /// note | "๊ธฐ์ˆ ์  ์„ธ๋ถ€์‚ฌํ•ญ"
    
    `from starlette.staticfiles import StaticFiles` ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2K bytes
    - Viewed (0)
  6. docs/pt/docs/how-to/conditional-openapi.md

    Vocรช pode usar facilmente as mesmas configuraรงรตes do Pydantic para configurar sua OpenAPI gerada e as interfaces de usuรกrio de documentos.
    
    Por exemplo:
    
    ```Python hl_lines="6  11"
    {!../../docs_src/conditional_openapi/tutorial001.py!}
    ```
    
    Aqui declaramos a configuraรงรฃo `openapi_url` com o mesmo padrรฃo de `"/openapi.json"`.
    
    E entรฃo o usamos ao criar o aplicativo `FastAPI`.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/debugging.md

    You can connect the debugger in your editor, for example with Visual Studio Code or PyCharm.
    
    ## Call `uvicorn`
    
    In your FastAPI application, import and run `uvicorn` directly:
    
    ```Python hl_lines="1  15"
    {!../../docs_src/debugging/tutorial001.py!}
    ```
    
    ### About `__name__ == "__main__"`
    
    The main purpose of the `__name__ == "__main__"` is to have some code that is executed when your file is called with:
    
    <div class="termy">
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_request_form_models/test_tutorial002.py

    import pytest
    from fastapi.testclient import TestClient
    
    from tests.utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.request_form_models.tutorial002 import app
    
        client = TestClient(app)
        return client
    
    
    @needs_pydanticv2
    def test_post_body_form(client: TestClient):
        response = client.post("/login/", data={"username": "Foo", "password": "secret"})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Sep 06 17:31:18 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_query_params/test_tutorial006_py310.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params.tutorial006_py310 import app
    
        c = TestClient(app)
        return c
    
    
    @needs_py310
    def test_foo_needy_very(client: TestClient):
        response = client.get("/items/foo?needy=very")
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py

    import pytest
    from dirty_equals import IsDict
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.query_params_str_validations.tutorial010 import app
    
        client = TestClient(app)
        return client
    
    
    def test_query_params_str_validations_no_query(client: TestClient):
        response = client.get("/items/")
        assert response.status_code == 200
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.2K bytes
    - Viewed (0)
Back to top