Search Options

Results per page
Sort
Preferred Languages
Advance

Results 801 - 810 of 877 for tutorial002 (0.16 sec)

  1. tests/test_tutorial/test_generate_clients/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.generate_clients.tutorial003 import app
    
    client = TestClient(app)
    
    
    def test_post_items():
        response = client.post("/items/", json={"name": "Foo", "price": 5})
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "Item received"}
    
    
    def test_post_users():
        response = client.post(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  2. docs/em/docs/how-to/graphql.md

    โš“๏ธ ๐Ÿ”› ๐Ÿ‘† โš™๏ธ ๐Ÿ’ผ, ๐Ÿ‘† 5๏ธโƒฃ๐Ÿ“† ๐Ÿ’– โš™๏ธ ๐ŸŽ ๐Ÿ—ƒ, โœ‹๏ธ ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ’ญ ๐Ÿ‘ค, ๐Ÿ‘ค ๐Ÿ”œ ๐ŸŽฒ ๐Ÿค” ๐Ÿ‘† ๐Ÿ”„ **๐Ÿ“**.
    
    ๐Ÿ“ฅ ๐Ÿคช ๐ŸŽฎ โ” ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ› ๏ธ ๐Ÿ“ โฎ๏ธ FastAPI:
    
    ```Python hl_lines="3  22  25-26"
    {!../../docs_src/graphql/tutorial001.py!}
    ```
    
    ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ’ก ๐ŸŒ… ๐Ÿ”ƒ ๐Ÿ“ <a href="https://strawberry.rocks/" class="external-link" target="_blank">๐Ÿ“ ๐Ÿงพ</a>.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 3K bytes
    - Viewed (0)
  3. docs/em/docs/advanced/templates.md

    * ๐Ÿ“ฃ `Request` ๐Ÿ”ข *โžก ๐Ÿ› ๏ธ* ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿ“จ ๐Ÿ“„.
    * โš™๏ธ `templates` ๐Ÿ‘† โœ โœ &amp; ๐Ÿ“จ `TemplateResponse`, ๐Ÿšถโ€โ™€๏ธ `request` 1๏ธโƒฃ ๐Ÿ”‘-๐Ÿ’ฒ ๐Ÿ‘ซ Jinja2๏ธโƒฃ "๐Ÿ”‘".
    
    ```Python hl_lines="4  11  15-18"
    {!../../docs_src/templates/tutorial001.py!}
    ```
    
    /// note
    
    ๐Ÿ‘€ ๐Ÿ‘ˆ ๐Ÿ‘† โœ”๏ธ ๐Ÿšถโ€โ™€๏ธ `request` ๐Ÿ• ๐Ÿ”‘-๐Ÿ’ฒ ๐Ÿ‘ซ ๐Ÿ”‘ Jinja2๏ธโƒฃ. , ๐Ÿ‘† โœ”๏ธ ๐Ÿ“ฃ โšซ๏ธ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ*.
    
    ///
    
    /// tip
    
    ๐Ÿ“ฃ `response_class=HTMLResponse` ๐Ÿฉบ ๐ŸŽš ๐Ÿ”œ ๐Ÿ’ช ๐Ÿ’ญ ๐Ÿ‘ˆ ๐Ÿ“จ ๐Ÿ”œ ๐Ÿ•ธ.
    
    ///
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  4. docs/em/docs/advanced/using-request-directly.md

    โœ‹๏ธ ๐Ÿ“ค ๐ŸŽฏ ๐Ÿ’ผ ๐ŸŒโ” โšซ๏ธ โš  ๐Ÿคš `Request` ๐ŸŽš.
    
    ## โš™๏ธ `Request` ๐ŸŽš ๐Ÿ”—
    
    โžก๏ธ ๐ŸŒˆ ๐Ÿ‘† ๐Ÿ’š ๐Ÿคš ๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿ“ข ๐Ÿ“ข/๐Ÿฆ  ๐Ÿ”˜ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข*.
    
    ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ” ๐Ÿ“จ ๐Ÿ”—.
    
    ```Python hl_lines="1  7-8"
    {!../../docs_src/using_request_directly/tutorial001.py!}
    ```
    
    ๐Ÿ“ฃ *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿ”ข โฎ๏ธ ๐Ÿ†Ž โž– `Request` **FastAPI** ๐Ÿ”œ ๐Ÿ’ญ ๐Ÿšถโ€โ™€๏ธ `Request` ๐Ÿ‘ˆ ๐Ÿ”ข.
    
    /// tip
    
    ๐Ÿ—’ ๐Ÿ‘ˆ ๐Ÿ‘‰ ๐Ÿ’ผ, ๐Ÿ‘ฅ ๐Ÿ“ฃ โžก ๐Ÿ”ข โคด๏ธ ๐Ÿ“จ ๐Ÿ”ข.
    
    , โžก ๐Ÿ”ข ๐Ÿ”œ โš—, โœ”, ๐Ÿ—œ โœ” ๐Ÿ†Ž &amp; โœ โฎ๏ธ ๐Ÿ—„.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  5. docs/zh/docs/tutorial/static-files.md

    # ้™ๆ€ๆ–‡ไปถ
    
    ๆ‚จๅฏไปฅไฝฟ็”จ `StaticFiles`ไปŽ็›ฎๅฝ•ไธญ่‡ชๅŠจๆไพ›้™ๆ€ๆ–‡ไปถใ€‚
    
    ## ไฝฟ็”จ`StaticFiles`
    
    * ๅฏผๅ…ฅ`StaticFiles`ใ€‚
    * "ๆŒ‚่ฝฝ"(Mount) ไธ€ไธช `StaticFiles()` ๅฎžไพ‹ๅˆฐไธ€ไธชๆŒ‡ๅฎš่ทฏๅพ„ใ€‚
    
    ```Python hl_lines="2  6"
    {!../../docs_src/static_files/tutorial001.py!}
    ```
    
    /// note | "ๆŠ€ๆœฏ็ป†่Š‚"
    
    ไฝ ไนŸๅฏไปฅ็”จ `from starlette.staticfiles import StaticFiles`ใ€‚
    
    **FastAPI** ๆไพ›ไบ†ๅ’Œ `starlette.staticfiles` ็›ธๅŒ็š„ `fastapi.staticfiles` ๏ผŒๅชๆ˜ฏไธบไบ†ๆ–นไพฟไฝ ๏ผŒๅผ€ๅ‘่€…ใ€‚ไฝ†ๅฎƒ็กฎๅฎžๆฅ่‡ชStarletteใ€‚
    
    ///
    
    ### ไป€ไนˆๆ˜ฏ"ๆŒ‚่ฝฝ"(Mounting)
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  6. 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)
  7. docs/zh/docs/advanced/using-request-directly.md

    ไธ่ฟ‡๏ผŒไปๅฏไปฅ้ชŒ่ฏใ€่ฝฌๆขไธŽๆณจ้‡Š๏ผˆไฝฟ็”จ Pydantic ๆจกๅž‹็š„่ฏทๆฑ‚ไฝ“็ญ‰๏ผ‰ๅ…ถๅฎƒๆญฃๅธธๅฃฐๆ˜Ž็š„ๅ‚ๆ•ฐใ€‚
    
    ไฝ†ๅœจๆŸไบ›็‰นๅฎšๆƒ…ๅ†ตไธ‹๏ผŒ่ฟ˜ๆ˜ฏ้œ€่ฆๆๅ– `Request` ๅฏน่ฑกใ€‚
    
    ## ็›ดๆŽฅไฝฟ็”จ `Request` ๅฏน่ฑก
    
    ๅ‡่ฎพ่ฆๅœจ*่ทฏๅพ„ๆ“ไฝœๅ‡ฝๆ•ฐ*ไธญ่Žทๅ–ๅฎขๆˆท็ซฏ IP ๅœฐๅ€ๅ’Œไธปๆœบใ€‚
    
    ๆญคๆ—ถ๏ผŒ้œ€่ฆ็›ดๆŽฅ่ฎฟ้—ฎ่ฏทๆฑ‚ใ€‚
    
    ```Python hl_lines="1  7-8"
    {!../../docs_src/using_request_directly/tutorial001.py!}
    ```
    
    ๆŠŠ*่ทฏๅพ„ๆ“ไฝœๅ‡ฝๆ•ฐ*็š„ๅ‚ๆ•ฐ็ฑปๅž‹ๅฃฐๆ˜Žไธบ `Request`๏ผŒ**FastAPI** ๅฐฑ่ƒฝๆŠŠ `Request` ไผ ้€’ๅˆฐๅ‚ๆ•ฐ้‡Œใ€‚
    
    /// tip | "ๆ็คบ"
    
    ๆณจๆ„๏ผŒๆœฌไพ‹้™คไบ†ๅฃฐๆ˜Ž่ฏทๆฑ‚ๅ‚ๆ•ฐไน‹ๅค–๏ผŒ่ฟ˜ๅฃฐๆ˜Žไบ†่ทฏๅพ„ๅ‚ๆ•ฐใ€‚
    
    ๅ› ๆญค๏ผŒ่ƒฝๅคŸๆๅ–ใ€้ชŒ่ฏ่ทฏๅพ„ๅ‚ๆ•ฐใ€ๅนถ่ฝฌๆขไธบๆŒ‡ๅฎš็ฑปๅž‹๏ผŒ่ฟ˜ๅฏไปฅ็”จ OpenAPI ๆณจ้‡Šใ€‚
    
    ๅŒๆ ท๏ผŒๆ‚จไนŸๅฏไปฅๆญฃๅธธๅฃฐๆ˜Žๅ…ถๅฎƒๅ‚ๆ•ฐ๏ผŒ่€Œไธ”่ฟ˜ๅฏไปฅๆๅ– `Request`ใ€‚
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. docs/en/docs/tutorial/debugging.md

    ## 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">
    
    ```console
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.4K bytes
    - Viewed (0)
Back to top