Browse Source

๐Ÿ”ง Remove `base_path` for `mdx_include` Markdown extension in MkDocs (#12391)

pull/12395/head
Sebastiรกn Ramรญrez 9 months ago
committed by GitHub
parent
commit
0f7d67e85c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 56
      docs/bn/docs/python-types.md
  2. 8
      docs/de/docs/advanced/additional-responses.md
  3. 10
      docs/de/docs/advanced/additional-status-codes.md
  4. 24
      docs/de/docs/advanced/advanced-dependencies.md
  5. 8
      docs/de/docs/advanced/async-tests.md
  6. 10
      docs/de/docs/advanced/behind-a-proxy.md
  7. 32
      docs/de/docs/advanced/custom-response.md
  8. 6
      docs/de/docs/advanced/dataclasses.md
  9. 12
      docs/de/docs/advanced/events.md
  10. 16
      docs/de/docs/advanced/generate-clients.md
  11. 6
      docs/de/docs/advanced/middleware.md
  12. 8
      docs/de/docs/advanced/openapi-callbacks.md
  13. 2
      docs/de/docs/advanced/openapi-webhooks.md
  14. 20
      docs/de/docs/advanced/path-operation-advanced-configuration.md
  15. 2
      docs/de/docs/advanced/response-change-status-code.md
  16. 4
      docs/de/docs/advanced/response-cookies.md
  17. 4
      docs/de/docs/advanced/response-directly.md
  18. 4
      docs/de/docs/advanced/response-headers.md
  19. 18
      docs/de/docs/advanced/security/http-basic-auth.md
  20. 96
      docs/de/docs/advanced/security/oauth2-scopes.md
  21. 36
      docs/de/docs/advanced/settings.md
  22. 6
      docs/de/docs/advanced/sub-applications.md
  23. 8
      docs/de/docs/advanced/templates.md
  24. 10
      docs/de/docs/advanced/testing-dependencies.md
  25. 2
      docs/de/docs/advanced/testing-events.md
  26. 2
      docs/de/docs/advanced/testing-websockets.md
  27. 2
      docs/de/docs/advanced/using-request-directly.md
  28. 20
      docs/de/docs/advanced/websockets.md
  29. 2
      docs/de/docs/advanced/wsgi.md
  30. 2
      docs/de/docs/how-to/conditional-openapi.md
  31. 8
      docs/de/docs/how-to/configure-swagger-ui.md
  32. 14
      docs/de/docs/how-to/custom-docs-ui-assets.md
  33. 12
      docs/de/docs/how-to/custom-request-and-route.md
  34. 10
      docs/de/docs/how-to/extending-openapi.md
  35. 2
      docs/de/docs/how-to/graphql.md
  36. 36
      docs/de/docs/how-to/separate-openapi-schemas.md
  37. 56
      docs/de/docs/python-types.md
  38. 16
      docs/de/docs/tutorial/background-tasks.md
  39. 30
      docs/de/docs/tutorial/bigger-applications.md
  40. 20
      docs/de/docs/tutorial/body-fields.md
  41. 44
      docs/de/docs/tutorial/body-multiple-params.md
  42. 56
      docs/de/docs/tutorial/body-nested-models.md
  43. 24
      docs/de/docs/tutorial/body-updates.md
  44. 24
      docs/de/docs/tutorial/body.md
  45. 20
      docs/de/docs/tutorial/cookie-params.md
  46. 70
      docs/de/docs/tutorial/dependencies/classes-as-dependencies.md
  47. 24
      docs/de/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md
  48. 28
      docs/de/docs/tutorial/dependencies/dependencies-with-yield.md
  49. 6
      docs/de/docs/tutorial/dependencies/global-dependencies.md
  50. 36
      docs/de/docs/tutorial/dependencies/index.md
  51. 30
      docs/de/docs/tutorial/dependencies/sub-dependencies.md
  52. 4
      docs/de/docs/tutorial/encoder.md
  53. 20
      docs/de/docs/tutorial/extra-data-types.md
  54. 20
      docs/de/docs/tutorial/extra-models.md
  55. 16
      docs/de/docs/tutorial/first-steps.md
  56. 16
      docs/de/docs/tutorial/handling-errors.md
  57. 42
      docs/de/docs/tutorial/header-params.md
  58. 12
      docs/de/docs/tutorial/metadata.md
  59. 4
      docs/de/docs/tutorial/middleware.md
  60. 34
      docs/de/docs/tutorial/path-operation-configuration.md
  61. 50
      docs/de/docs/tutorial/path-params-numeric-validations.md
  62. 20
      docs/de/docs/tutorial/path-params.md
  63. 142
      docs/de/docs/tutorial/query-params-str-validations.md
  64. 20
      docs/de/docs/tutorial/query-params.md
  65. 50
      docs/de/docs/tutorial/request-files.md
  66. 12
      docs/de/docs/tutorial/request-forms-and-files.md
  67. 12
      docs/de/docs/tutorial/request-forms.md
  68. 68
      docs/de/docs/tutorial/response-model.md
  69. 6
      docs/de/docs/tutorial/response-status-code.md
  70. 42
      docs/de/docs/tutorial/schema-extra-example.md
  71. 18
      docs/de/docs/tutorial/security/first-steps.md
  72. 56
      docs/de/docs/tutorial/security/get-current-user.md
  73. 40
      docs/de/docs/tutorial/security/oauth2-jwt.md
  74. 50
      docs/de/docs/tutorial/security/simple-oauth2.md
  75. 2
      docs/de/docs/tutorial/static-files.md
  76. 18
      docs/de/docs/tutorial/testing.md
  77. 8
      docs/em/docs/advanced/additional-responses.md
  78. 2
      docs/em/docs/advanced/additional-status-codes.md
  79. 8
      docs/em/docs/advanced/advanced-dependencies.md
  80. 8
      docs/em/docs/advanced/async-tests.md
  81. 8
      docs/em/docs/advanced/behind-a-proxy.md
  82. 32
      docs/em/docs/advanced/custom-response.md
  83. 6
      docs/em/docs/advanced/dataclasses.md
  84. 12
      docs/em/docs/advanced/events.md
  85. 14
      docs/em/docs/advanced/generate-clients.md
  86. 6
      docs/em/docs/advanced/middleware.md
  87. 8
      docs/em/docs/advanced/openapi-callbacks.md
  88. 16
      docs/em/docs/advanced/path-operation-advanced-configuration.md
  89. 2
      docs/em/docs/advanced/response-change-status-code.md
  90. 4
      docs/em/docs/advanced/response-cookies.md
  91. 4
      docs/em/docs/advanced/response-directly.md
  92. 4
      docs/em/docs/advanced/response-headers.md
  93. 6
      docs/em/docs/advanced/security/http-basic-auth.md
  94. 16
      docs/em/docs/advanced/security/oauth2-scopes.md
  95. 20
      docs/em/docs/advanced/settings.md
  96. 6
      docs/em/docs/advanced/sub-applications.md
  97. 8
      docs/em/docs/advanced/templates.md
  98. 8
      docs/em/docs/advanced/testing-database.md
  99. 2
      docs/em/docs/advanced/testing-dependencies.md
  100. 2
      docs/em/docs/advanced/testing-events.md

56
docs/bn/docs/python-types.md

@ -23,7 +23,7 @@ Python-เฆ เฆเฆšเงเฆ›เฆฟเฆ• "เฆŸเฆพเฆ‡เฆช เฆนเฆฟเฆจเงเฆŸ" (เฆฏเฆพ "เฆŸเฆพเฆ‡
เฆšเฆฒเงเฆจ เฆเฆ•เฆŸเฆฟ เฆธเฆพเฆงเฆพเฆฐเฆฃ เฆ‰เฆฆเฆพเฆนเฆฐเฆฃ เฆฆเฆฟเฆฏเฆผเง‡ เฆถเงเฆฐเง เฆ•เฆฐเฆฟ: เฆšเฆฒเงเฆจ เฆเฆ•เฆŸเฆฟ เฆธเฆพเฆงเฆพเฆฐเฆฃ เฆ‰เฆฆเฆพเฆนเฆฐเฆฃ เฆฆเฆฟเฆฏเฆผเง‡ เฆถเงเฆฐเง เฆ•เฆฐเฆฟ:
```Python ```Python
{!../../../docs_src/python_types/tutorial001.py!} {!../../docs_src/python_types/tutorial001.py!}
``` ```
เฆเฆ‡ เฆชเงเฆฐเง‹เฆ—เงเฆฐเฆพเฆฎเฆŸเฆฟ เฆ•เฆฒ เฆ•เฆฐเฆฒเง‡ เฆ†เฆ‰เฆŸเฆชเงเฆŸ เฆนเฆฏเฆผ: เฆเฆ‡ เฆชเงเฆฐเง‹เฆ—เงเฆฐเฆพเฆฎเฆŸเฆฟ เฆ•เฆฒ เฆ•เฆฐเฆฒเง‡ เฆ†เฆ‰เฆŸเฆชเงเฆŸ เฆนเฆฏเฆผ:
@ -39,7 +39,7 @@ John Doe
* เฆคเฆพเฆฆเง‡เฆฐเฆ•เง‡ เฆฎเฆพเฆเฆ–เฆพเฆจเง‡ เฆเฆ•เฆŸเฆฟ เฆธเงเฆชเง‡เฆธ เฆฆเฆฟเฆฏเฆผเง‡ <abbr title="เฆเฆ•เฆŸเฆพเฆฐ เฆชเฆฐเง‡ เฆเฆ•เฆŸเฆพ เฆเฆ•เฆคเงเฆฐเฆฟเฆค เฆ•เฆฐเฆพ">concatenate</abbr> เฆ•เฆฐเง‡เฅค * เฆคเฆพเฆฆเง‡เฆฐเฆ•เง‡ เฆฎเฆพเฆเฆ–เฆพเฆจเง‡ เฆเฆ•เฆŸเฆฟ เฆธเงเฆชเง‡เฆธ เฆฆเฆฟเฆฏเฆผเง‡ <abbr title="เฆเฆ•เฆŸเฆพเฆฐ เฆชเฆฐเง‡ เฆเฆ•เฆŸเฆพ เฆเฆ•เฆคเงเฆฐเฆฟเฆค เฆ•เฆฐเฆพ">concatenate</abbr> เฆ•เฆฐเง‡เฅค
```Python hl_lines="2" ```Python hl_lines="2"
{!../../../docs_src/python_types/tutorial001.py!} {!../../docs_src/python_types/tutorial001.py!}
``` ```
### เฆเฆŸเฆฟ เฆธเฆฎเงเฆชเฆพเฆฆเฆจเฆพ เฆ•เฆฐเงเฆจ ### เฆเฆŸเฆฟ เฆธเฆฎเงเฆชเฆพเฆฆเฆจเฆพ เฆ•เฆฐเงเฆจ
@ -83,7 +83,7 @@ John Doe
เฆเฆ—เงเฆฒเฆฟเฆ‡ "เฆŸเฆพเฆ‡เฆช เฆนเฆฟเฆจเงเฆŸ": เฆเฆ—เงเฆฒเฆฟเฆ‡ "เฆŸเฆพเฆ‡เฆช เฆนเฆฟเฆจเงเฆŸ":
```Python hl_lines="1" ```Python hl_lines="1"
{!../../../docs_src/python_types/tutorial002.py!} {!../../docs_src/python_types/tutorial002.py!}
``` ```
เฆเฆŸเฆฟ เฆกเฆฟเฆซเฆฒเงเฆŸ เฆญเงเฆฏเฆพเฆฒเง เฆ˜เง‹เฆทเฆฃเฆพ เฆ•เฆฐเฆพเฆฐ เฆฎเฆค เฆจเฆฏเฆผ เฆฏเง‡เฆฎเฆจ: เฆเฆŸเฆฟ เฆกเฆฟเฆซเฆฒเงเฆŸ เฆญเงเฆฏเฆพเฆฒเง เฆ˜เง‹เฆทเฆฃเฆพ เฆ•เฆฐเฆพเฆฐ เฆฎเฆค เฆจเฆฏเฆผ เฆฏเง‡เฆฎเฆจ:
@ -113,7 +113,7 @@ John Doe
เฆเฆ‡ เฆซเฆพเฆ‚เฆถเฆจเฆŸเฆฟ เฆฆเง‡เฆ–เงเฆจ, เฆเฆŸเฆฟเฆคเง‡ เฆ‡เฆคเฆฟเฆฎเฆงเงเฆฏเง‡ เฆŸเฆพเฆ‡เฆช เฆนเฆฟเฆจเงเฆŸ เฆฐเฆฏเฆผเง‡เฆ›เง‡: เฆเฆ‡ เฆซเฆพเฆ‚เฆถเฆจเฆŸเฆฟ เฆฆเง‡เฆ–เงเฆจ, เฆเฆŸเฆฟเฆคเง‡ เฆ‡เฆคเฆฟเฆฎเฆงเงเฆฏเง‡ เฆŸเฆพเฆ‡เฆช เฆนเฆฟเฆจเงเฆŸ เฆฐเฆฏเฆผเง‡เฆ›เง‡:
```Python hl_lines="1" ```Python hl_lines="1"
{!../../../docs_src/python_types/tutorial003.py!} {!../../docs_src/python_types/tutorial003.py!}
``` ```
เฆเฆกเฆฟเฆŸเฆฐ เฆญเง‡เฆฐเฆฟเฆฏเฆผเง‡เฆฌเฆฒเฆ—เงเฆฒเฆฟเฆฐ เฆŸเฆพเฆ‡เฆช เฆœเฆพเฆจเฆพเฆฐ เฆ•เฆพเฆฐเฆฃเง‡, เฆ†เฆชเฆจเฆฟ เฆถเงเฆงเงเฆฎเฆพเฆคเงเฆฐ เฆ…เฆŸเง‹เฆ•เฆฎเฆชเงเฆฒเฆฟเฆถเฆจเฆ‡ เฆชเฆพเฆจ เฆจเฆพ, เฆ†เฆชเฆจเฆฟ เฆเฆฐเฆฐ เฆšเง‡เฆ•เฆ“ เฆชเฆพเฆจ: เฆเฆกเฆฟเฆŸเฆฐ เฆญเง‡เฆฐเฆฟเฆฏเฆผเง‡เฆฌเฆฒเฆ—เงเฆฒเฆฟเฆฐ เฆŸเฆพเฆ‡เฆช เฆœเฆพเฆจเฆพเฆฐ เฆ•เฆพเฆฐเฆฃเง‡, เฆ†เฆชเฆจเฆฟ เฆถเงเฆงเงเฆฎเฆพเฆคเงเฆฐ เฆ…เฆŸเง‹เฆ•เฆฎเฆชเงเฆฒเฆฟเฆถเฆจเฆ‡ เฆชเฆพเฆจ เฆจเฆพ, เฆ†เฆชเฆจเฆฟ เฆเฆฐเฆฐ เฆšเง‡เฆ•เฆ“ เฆชเฆพเฆจ:
@ -123,7 +123,7 @@ John Doe
เฆเฆ–เฆจ เฆ†เฆชเฆจเฆฟ เฆœเฆพเฆจเง‡เฆจ เฆฏเง‡ เฆ†เฆชเฆจเฆพเฆ•เง‡ เฆเฆŸเฆฟ เฆ เฆฟเฆ• เฆ•เฆฐเฆคเง‡ เฆนเฆฌเง‡, `age`-เฆ•เง‡ เฆเฆ•เฆŸเฆฟ เฆธเงเฆŸเงเฆฐเฆฟเฆ‚ เฆนเฆฟเฆธเง‡เฆฌเง‡ เฆฐเง‚เฆชเฆพเฆจเงเฆคเฆฐ เฆ•เฆฐเฆคเง‡ `str(age)` เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเฆคเง‡ เฆนเฆฌเง‡: เฆเฆ–เฆจ เฆ†เฆชเฆจเฆฟ เฆœเฆพเฆจเง‡เฆจ เฆฏเง‡ เฆ†เฆชเฆจเฆพเฆ•เง‡ เฆเฆŸเฆฟ เฆ เฆฟเฆ• เฆ•เฆฐเฆคเง‡ เฆนเฆฌเง‡, `age`-เฆ•เง‡ เฆเฆ•เฆŸเฆฟ เฆธเงเฆŸเงเฆฐเฆฟเฆ‚ เฆนเฆฟเฆธเง‡เฆฌเง‡ เฆฐเง‚เฆชเฆพเฆจเงเฆคเฆฐ เฆ•เฆฐเฆคเง‡ `str(age)` เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเฆคเง‡ เฆนเฆฌเง‡:
```Python hl_lines="2" ```Python hl_lines="2"
{!../../../docs_src/python_types/tutorial004.py!} {!../../docs_src/python_types/tutorial004.py!}
``` ```
## เฆŸเฆพเฆ‡เฆช เฆ˜เง‹เฆทเฆฃเฆพ ## เฆŸเฆพเฆ‡เฆช เฆ˜เง‹เฆทเฆฃเฆพ
@ -144,7 +144,7 @@ John Doe
* `bytes` * `bytes`
```Python hl_lines="1" ```Python hl_lines="1"
{!../../../docs_src/python_types/tutorial005.py!} {!../../docs_src/python_types/tutorial005.py!}
``` ```
### เฆŸเฆพเฆ‡เฆช เฆชเงเฆฏเฆพเฆฐเฆพเฆฎเฆฟเฆŸเฆพเฆฐ เฆธเฆน เฆœเง‡เฆจเง‡เฆฐเฆฟเฆ• เฆŸเฆพเฆ‡เฆช ### เฆŸเฆพเฆ‡เฆช เฆชเงเฆฏเฆพเฆฐเฆพเฆฎเฆฟเฆŸเฆพเฆฐ เฆธเฆน เฆœเง‡เฆจเง‡เฆฐเฆฟเฆ• เฆŸเฆพเฆ‡เฆช
@ -182,7 +182,7 @@ Python เฆฏเฆค เฆเฆ—เฆฟเฆฏเฆผเง‡ เฆฏเฆพเฆšเงเฆ›เง‡, **เฆจเฆคเงเฆจ เฆธเฆ‚เฆธเง
เฆฏเง‡เฆนเง‡เฆคเง เฆฒเฆฟเฆธเงเฆŸ เฆเฆฎเฆจ เฆเฆ•เฆŸเฆฟ เฆŸเฆพเฆ‡เฆช เฆฏเฆพ เฆ…เฆญเงเฆฏเฆจเงเฆคเฆฐเง€เฆฃ เฆŸเฆพเฆ‡เฆชเฆ—เงเฆฒเฆฟ เฆงเฆพเฆฐเฆฃ เฆ•เฆฐเง‡, เฆ†เฆชเฆจเฆฟ เฆคเฆพเฆฆเง‡เฆฐ เฆธเงเฆ•เง‹เฆฏเฆผเฆพเฆฐ เฆฌเงเฆฐเฆพเฆ•เง‡เฆŸเง‡เฆฐ เฆญเฆฟเฆคเฆฐเง‡ เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเงเฆจ: เฆฏเง‡เฆนเง‡เฆคเง เฆฒเฆฟเฆธเงเฆŸ เฆเฆฎเฆจ เฆเฆ•เฆŸเฆฟ เฆŸเฆพเฆ‡เฆช เฆฏเฆพ เฆ…เฆญเงเฆฏเฆจเงเฆคเฆฐเง€เฆฃ เฆŸเฆพเฆ‡เฆชเฆ—เงเฆฒเฆฟ เฆงเฆพเฆฐเฆฃ เฆ•เฆฐเง‡, เฆ†เฆชเฆจเฆฟ เฆคเฆพเฆฆเง‡เฆฐ เฆธเงเฆ•เง‹เฆฏเฆผเฆพเฆฐ เฆฌเงเฆฐเฆพเฆ•เง‡เฆŸเง‡เฆฐ เฆญเฆฟเฆคเฆฐเง‡ เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเงเฆจ:
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006_py39.py!} {!> ../../docs_src/python_types/tutorial006_py39.py!}
``` ```
//// ////
@ -192,7 +192,7 @@ Python เฆฏเฆค เฆเฆ—เฆฟเฆฏเฆผเง‡ เฆฏเฆพเฆšเงเฆ›เง‡, **เฆจเฆคเงเฆจ เฆธเฆ‚เฆธเง
`typing` เฆฅเง‡เฆ•เง‡ `List` (เฆฌเฆกเฆผ เฆนเฆพเฆคเง‡เฆฐ `L` เฆฆเฆฟเฆฏเฆผเง‡) เฆ‡เฆฎเฆชเง‹เฆฐเงเฆŸ เฆ•เฆฐเงเฆจ: `typing` เฆฅเง‡เฆ•เง‡ `List` (เฆฌเฆกเฆผ เฆนเฆพเฆคเง‡เฆฐ `L` เฆฆเฆฟเฆฏเฆผเง‡) เฆ‡เฆฎเฆชเง‹เฆฐเงเฆŸ เฆ•เฆฐเงเฆจ:
``` Python hl_lines="1" ``` Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!} {!> ../../docs_src/python_types/tutorial006.py!}
``` ```
เฆญเง‡เฆฐเฆฟเฆฏเฆผเง‡เฆฌเฆฒเฆŸเฆฟ เฆ˜เง‹เฆทเฆฃเฆพ เฆ•เฆฐเงเฆจ, เฆเฆ•เฆ‡ เฆ•เง‹เฆฒเฆจ (`:`) เฆธเฆฟเฆจเฆŸเงเฆฏเฆพเฆ•เงเฆธ เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเง‡เฅค เฆญเง‡เฆฐเฆฟเฆฏเฆผเง‡เฆฌเฆฒเฆŸเฆฟ เฆ˜เง‹เฆทเฆฃเฆพ เฆ•เฆฐเงเฆจ, เฆเฆ•เฆ‡ เฆ•เง‹เฆฒเฆจ (`:`) เฆธเฆฟเฆจเฆŸเงเฆฏเฆพเฆ•เงเฆธ เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเง‡เฅค
@ -202,7 +202,7 @@ Python เฆฏเฆค เฆเฆ—เฆฟเฆฏเฆผเง‡ เฆฏเฆพเฆšเงเฆ›เง‡, **เฆจเฆคเงเฆจ เฆธเฆ‚เฆธเง
เฆฏเง‡เฆนเง‡เฆคเง เฆฒเฆฟเฆธเงเฆŸ เฆเฆฎเฆจ เฆเฆ•เฆŸเฆฟ เฆŸเฆพเฆ‡เฆช เฆฏเฆพ เฆ…เฆญเงเฆฏเฆจเงเฆคเฆฐเง€เฆฃ เฆŸเฆพเฆ‡เฆชเฆ—เงเฆฒเฆฟ เฆงเฆพเฆฐเฆฃ เฆ•เฆฐเง‡, เฆ†เฆชเฆจเฆฟ เฆคเฆพเฆฆเง‡เฆฐ เฆธเงเฆ•เง‹เฆฏเฆผเฆพเฆฐ เฆฌเงเฆฐเฆพเฆ•เง‡เฆŸเง‡เฆฐ เฆญเฆฟเฆคเฆฐเง‡ เฆ•เฆฐเงเฆจ: เฆฏเง‡เฆนเง‡เฆคเง เฆฒเฆฟเฆธเงเฆŸ เฆเฆฎเฆจ เฆเฆ•เฆŸเฆฟ เฆŸเฆพเฆ‡เฆช เฆฏเฆพ เฆ…เฆญเงเฆฏเฆจเงเฆคเฆฐเง€เฆฃ เฆŸเฆพเฆ‡เฆชเฆ—เงเฆฒเฆฟ เฆงเฆพเฆฐเฆฃ เฆ•เฆฐเง‡, เฆ†เฆชเฆจเฆฟ เฆคเฆพเฆฆเง‡เฆฐ เฆธเงเฆ•เง‹เฆฏเฆผเฆพเฆฐ เฆฌเงเฆฐเฆพเฆ•เง‡เฆŸเง‡เฆฐ เฆญเฆฟเฆคเฆฐเง‡ เฆ•เฆฐเงเฆจ:
```Python hl_lines="4" ```Python hl_lines="4"
{!> ../../../docs_src/python_types/tutorial006.py!} {!> ../../docs_src/python_types/tutorial006.py!}
``` ```
//// ////
@ -240,7 +240,7 @@ Python เฆฏเฆค เฆเฆ—เฆฟเฆฏเฆผเง‡ เฆฏเฆพเฆšเงเฆ›เง‡, **เฆจเฆคเงเฆจ เฆธเฆ‚เฆธเง
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial007_py39.py!} {!> ../../docs_src/python_types/tutorial007_py39.py!}
``` ```
//// ////
@ -248,7 +248,7 @@ Python เฆฏเฆค เฆเฆ—เฆฟเฆฏเฆผเง‡ เฆฏเฆพเฆšเงเฆ›เง‡, **เฆจเฆคเงเฆจ เฆธเฆ‚เฆธเง
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial007.py!} {!> ../../docs_src/python_types/tutorial007.py!}
``` ```
//// ////
@ -269,7 +269,7 @@ Python เฆฏเฆค เฆเฆ—เฆฟเฆฏเฆผเง‡ เฆฏเฆพเฆšเงเฆ›เง‡, **เฆจเฆคเงเฆจ เฆธเฆ‚เฆธเง
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial008_py39.py!} {!> ../../docs_src/python_types/tutorial008_py39.py!}
``` ```
//// ////
@ -277,7 +277,7 @@ Python เฆฏเฆค เฆเฆ—เฆฟเฆฏเฆผเง‡ เฆฏเฆพเฆšเงเฆ›เง‡, **เฆจเฆคเงเฆจ เฆธเฆ‚เฆธเง
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial008.py!} {!> ../../docs_src/python_types/tutorial008.py!}
``` ```
//// ////
@ -299,7 +299,7 @@ Python 3.10-เฆ เฆเฆ•เฆŸเฆฟ **เฆจเฆคเงเฆจ เฆธเฆฟเฆจเฆŸเงเฆฏเฆพเฆ•เงเฆธ** เฆ†
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial008b_py310.py!} {!> ../../docs_src/python_types/tutorial008b_py310.py!}
``` ```
//// ////
@ -307,7 +307,7 @@ Python 3.10-เฆ เฆเฆ•เฆŸเฆฟ **เฆจเฆคเงเฆจ เฆธเฆฟเฆจเฆŸเงเฆฏเฆพเฆ•เงเฆธ** เฆ†
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial008b.py!} {!> ../../docs_src/python_types/tutorial008b.py!}
``` ```
//// ////
@ -321,7 +321,7 @@ Python 3.10-เฆ เฆเฆ•เฆŸเฆฟ **เฆจเฆคเงเฆจ เฆธเฆฟเฆจเฆŸเงเฆฏเฆพเฆ•เงเฆธ** เฆ†
Python 3.6 เฆเฆฌเฆ‚ เฆคเฆพเฆฐ เฆ‰เฆชเฆฐเง‡เฆฐ เฆธเฆ‚เฆธเงเฆ•เฆฐเฆฃเฆ—เงเฆฒเฆฟเฆคเง‡ (Python 3.10 เฆ…เฆจเฆคเฆฐเงเฆญเงเฆ•เงเฆค) เฆ†เฆชเฆจเฆฟ `typing` เฆฎเฆกเฆฟเฆ‰เฆฒ เฆฅเง‡เฆ•เง‡ `Optional` เฆ‡เฆฎเฆชเง‹เฆฐเงเฆŸ เฆ•เฆฐเง‡ เฆเฆŸเฆฟ เฆ˜เง‹เฆทเฆฃเฆพ เฆเฆฌเฆ‚ เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเง‡เฆจเฅค Python 3.6 เฆเฆฌเฆ‚ เฆคเฆพเฆฐ เฆ‰เฆชเฆฐเง‡เฆฐ เฆธเฆ‚เฆธเงเฆ•เฆฐเฆฃเฆ—เงเฆฒเฆฟเฆคเง‡ (Python 3.10 เฆ…เฆจเฆคเฆฐเงเฆญเงเฆ•เงเฆค) เฆ†เฆชเฆจเฆฟ `typing` เฆฎเฆกเฆฟเฆ‰เฆฒ เฆฅเง‡เฆ•เง‡ `Optional` เฆ‡เฆฎเฆชเง‹เฆฐเงเฆŸ เฆ•เฆฐเง‡ เฆเฆŸเฆฟ เฆ˜เง‹เฆทเฆฃเฆพ เฆเฆฌเฆ‚ เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเง‡เฆจเฅค
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!../../../docs_src/python_types/tutorial009.py!} {!../../docs_src/python_types/tutorial009.py!}
``` ```
`Optional[str]` เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเฆพ เฆฎเฆพเฆจเง‡ เฆนเฆฒ เฆถเงเฆงเง `str` เฆจเฆฏเฆผ, เฆเฆŸเฆฟ เฆนเฆคเง‡ เฆชเฆพเฆฐเง‡ `None`-เฆ“, เฆฏเฆพ เฆ†เฆชเฆจเฆพเฆฐ เฆเฆกเฆฟเฆŸเฆฐเฆ•เง‡ เฆธเง‡เฆ‡ เฆคเงเฆฐเงเฆŸเฆฟเฆ—เงเฆฒเฆฟ เฆถเฆจเฆพเฆ•เงเฆค เฆ•เฆฐเฆคเง‡ เฆธเฆพเฆนเฆพเฆฏเงเฆฏ เฆ•เฆฐเฆฌเง‡ เฆฏเง‡เฆ–เฆพเฆจเง‡ เฆ†เฆชเฆจเฆฟ เฆงเฆฐเง‡ เฆจเฆฟเฆšเงเฆ›เง‡เฆจ เฆฏเง‡ เฆเฆ•เฆŸเฆฟ เฆฎเฆพเฆจ เฆธเฆฌเฆธเฆฎเฆฏเฆผ `str` เฆนเฆฌเง‡, เฆ…เฆฅเฆš เฆเฆŸเฆฟ `None`-เฆ“ เฆนเฆคเง‡ เฆชเฆพเฆฐเง‡เฆ“เฅค `Optional[str]` เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเฆพ เฆฎเฆพเฆจเง‡ เฆนเฆฒ เฆถเงเฆงเง `str` เฆจเฆฏเฆผ, เฆเฆŸเฆฟ เฆนเฆคเง‡ เฆชเฆพเฆฐเง‡ `None`-เฆ“, เฆฏเฆพ เฆ†เฆชเฆจเฆพเฆฐ เฆเฆกเฆฟเฆŸเฆฐเฆ•เง‡ เฆธเง‡เฆ‡ เฆคเงเฆฐเงเฆŸเฆฟเฆ—เงเฆฒเฆฟ เฆถเฆจเฆพเฆ•เงเฆค เฆ•เฆฐเฆคเง‡ เฆธเฆพเฆนเฆพเฆฏเงเฆฏ เฆ•เฆฐเฆฌเง‡ เฆฏเง‡เฆ–เฆพเฆจเง‡ เฆ†เฆชเฆจเฆฟ เฆงเฆฐเง‡ เฆจเฆฟเฆšเงเฆ›เง‡เฆจ เฆฏเง‡ เฆเฆ•เฆŸเฆฟ เฆฎเฆพเฆจ เฆธเฆฌเฆธเฆฎเฆฏเฆผ `str` เฆนเฆฌเง‡, เฆ…เฆฅเฆš เฆเฆŸเฆฟ `None`-เฆ“ เฆนเฆคเง‡ เฆชเฆพเฆฐเง‡เฆ“เฅค
@ -333,7 +333,7 @@ Python 3.6 เฆเฆฌเฆ‚ เฆคเฆพเฆฐ เฆ‰เฆชเฆฐเง‡เฆฐ เฆธเฆ‚เฆธเงเฆ•เฆฐเฆฃเฆ—เงเฆฒเฆฟ
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial009_py310.py!} {!> ../../docs_src/python_types/tutorial009_py310.py!}
``` ```
//// ////
@ -341,7 +341,7 @@ Python 3.6 เฆเฆฌเฆ‚ เฆคเฆพเฆฐ เฆ‰เฆชเฆฐเง‡เฆฐ เฆธเฆ‚เฆธเงเฆ•เฆฐเฆฃเฆ—เงเฆฒเฆฟ
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial009.py!} {!> ../../docs_src/python_types/tutorial009.py!}
``` ```
//// ////
@ -349,7 +349,7 @@ Python 3.6 เฆเฆฌเฆ‚ เฆคเฆพเฆฐ เฆ‰เฆชเฆฐเง‡เฆฐ เฆธเฆ‚เฆธเงเฆ•เฆฐเฆฃเฆ—เงเฆฒเฆฟ
//// tab | Python 3.8+ เฆฌเฆฟเฆ•เฆฒเงเฆช //// tab | Python 3.8+ เฆฌเฆฟเฆ•เฆฒเงเฆช
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial009b.py!} {!> ../../docs_src/python_types/tutorial009b.py!}
``` ```
//// ////
@ -370,7 +370,7 @@ Python 3.6 เฆเฆฌเฆ‚ เฆคเฆพเฆฐ เฆ‰เฆชเฆฐเง‡เฆฐ เฆธเฆ‚เฆธเงเฆ•เฆฐเฆฃเฆ—เงเฆฒเฆฟ
เฆเฆ•เฆŸเฆฟ เฆ‰เฆฆเฆพเฆนเฆฐเฆฃ เฆนเฆฟเฆธเง‡เฆฌเง‡, เฆเฆ‡ เฆซเฆพเฆ‚เฆถเฆจเฆŸเฆฟ เฆจเฆฟเฆจ: เฆเฆ•เฆŸเฆฟ เฆ‰เฆฆเฆพเฆนเฆฐเฆฃ เฆนเฆฟเฆธเง‡เฆฌเง‡, เฆเฆ‡ เฆซเฆพเฆ‚เฆถเฆจเฆŸเฆฟ เฆจเฆฟเฆจ:
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!../../../docs_src/python_types/tutorial009c.py!} {!../../docs_src/python_types/tutorial009c.py!}
``` ```
`name` เฆชเงเฆฏเฆพเฆฐเฆพเฆฎเฆฟเฆŸเฆพเฆฐเฆŸเฆฟ `Optional[str]` เฆนเฆฟเฆธเง‡เฆฌเง‡ เฆธเฆ‚เฆœเงเฆžเฆพเฆฏเฆผเฆฟเฆค เฆนเฆฏเฆผเง‡เฆ›เง‡, เฆ•เฆฟเฆจเงเฆคเง เฆเฆŸเฆฟ **เฆ…เฆชเฆถเฆจเฆพเฆฒ เฆจเฆฏเฆผ**, เฆ†เฆชเฆจเฆฟ เฆชเงเฆฏเฆพเฆฐเฆพเฆฎเฆฟเฆŸเฆพเฆฐ เฆ›เฆพเฆกเฆผเฆพ เฆซเฆพเฆ‚เฆถเฆจเฆŸเฆฟ เฆ•เฆฒ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเฆฌเง‡เฆจ เฆจเฆพ: `name` เฆชเงเฆฏเฆพเฆฐเฆพเฆฎเฆฟเฆŸเฆพเฆฐเฆŸเฆฟ `Optional[str]` เฆนเฆฟเฆธเง‡เฆฌเง‡ เฆธเฆ‚เฆœเงเฆžเฆพเฆฏเฆผเฆฟเฆค เฆนเฆฏเฆผเง‡เฆ›เง‡, เฆ•เฆฟเฆจเงเฆคเง เฆเฆŸเฆฟ **เฆ…เฆชเฆถเฆจเฆพเฆฒ เฆจเฆฏเฆผ**, เฆ†เฆชเฆจเฆฟ เฆชเงเฆฏเฆพเฆฐเฆพเฆฎเฆฟเฆŸเฆพเฆฐ เฆ›เฆพเฆกเฆผเฆพ เฆซเฆพเฆ‚เฆถเฆจเฆŸเฆฟ เฆ•เฆฒ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเฆฌเง‡เฆจ เฆจเฆพ:
@ -388,7 +388,7 @@ say_hi(name=None) # เฆเฆŸเฆฟ เฆ•เฆพเฆœ เฆ•เฆฐเง‡, None เฆฌเงˆเฆง ๐ŸŽ‰
เฆธเงเฆ–เฆฌเฆฐ เฆนเฆฒ, เฆเฆ•เฆฌเฆพเฆฐ เฆ†เฆชเฆจเฆฟ Python 3.10 เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเฆพ เฆถเงเฆฐเง เฆ•เฆฐเฆฒเง‡, เฆ†เฆชเฆจเฆพเฆ•เง‡ เฆเฆ—เงเฆฒเง‹เฆฐ เฆฌเงเฆฏเฆพเฆชเฆพเฆฐเง‡ เฆ†เฆฐ เฆšเฆฟเฆจเงเฆคเฆพ เฆ•เฆฐเฆคเง‡ เฆนเฆฌเง‡ เฆจเฆพ, เฆฏเง‡เฆนเงเฆคเง เฆ†เฆชเฆจเฆฟ | เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเง‡เฆ‡ เฆ‡เฆ‰เฆจเฆฟเฆฏเฆผเฆจ เฆ˜เง‹เฆทเฆฃเฆพ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเฆฌเง‡เฆจ: เฆธเงเฆ–เฆฌเฆฐ เฆนเฆฒ, เฆเฆ•เฆฌเฆพเฆฐ เฆ†เฆชเฆจเฆฟ Python 3.10 เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเฆพ เฆถเงเฆฐเง เฆ•เฆฐเฆฒเง‡, เฆ†เฆชเฆจเฆพเฆ•เง‡ เฆเฆ—เงเฆฒเง‹เฆฐ เฆฌเงเฆฏเฆพเฆชเฆพเฆฐเง‡ เฆ†เฆฐ เฆšเฆฟเฆจเงเฆคเฆพ เฆ•เฆฐเฆคเง‡ เฆนเฆฌเง‡ เฆจเฆพ, เฆฏเง‡เฆนเงเฆคเง เฆ†เฆชเฆจเฆฟ | เฆฌเงเฆฏเฆฌเฆนเฆพเฆฐ เฆ•เฆฐเง‡เฆ‡ เฆ‡เฆ‰เฆจเฆฟเฆฏเฆผเฆจ เฆ˜เง‹เฆทเฆฃเฆพ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเฆฌเง‡เฆจ:
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!../../../docs_src/python_types/tutorial009c_py310.py!} {!../../docs_src/python_types/tutorial009c_py310.py!}
``` ```
เฆเฆฌเฆ‚ เฆคเฆพเฆฐเฆชเฆฐ เฆ†เฆชเฆจเฆพเฆ•เง‡ เฆจเฆพเฆฎเฆ—เงเฆฒเฆฟ เฆฏเง‡เฆฎเฆจ `Optional` เฆเฆฌเฆ‚ `Union` เฆจเฆฟเฆฏเฆผเง‡ เฆ†เฆฐ เฆšเฆฟเฆจเงเฆคเฆพ เฆ•เฆฐเฆคเง‡ เฆนเฆฌเง‡ เฆจเฆพเฅค ๐Ÿ˜Ž เฆเฆฌเฆ‚ เฆคเฆพเฆฐเฆชเฆฐ เฆ†เฆชเฆจเฆพเฆ•เง‡ เฆจเฆพเฆฎเฆ—เงเฆฒเฆฟ เฆฏเง‡เฆฎเฆจ `Optional` เฆเฆฌเฆ‚ `Union` เฆจเฆฟเฆฏเฆผเง‡ เฆ†เฆฐ เฆšเฆฟเฆจเงเฆคเฆพ เฆ•เฆฐเฆคเง‡ เฆนเฆฌเง‡ เฆจเฆพเฅค ๐Ÿ˜Ž
@ -452,13 +452,13 @@ Python 3.10-เฆ, `Union` เฆเฆฌเฆ‚ `Optional` เฆœเง‡เฆจเง‡เฆฐเฆฟเฆ•เฆธ เฆฌเงเฆฏ
เฆงเฆฐเงเฆจ เฆ†เฆชเฆจเฆพเฆฐ เฆ•เฆพเฆ›เง‡ `Person` เฆจเฆพเฆฎเง‡ เฆเฆ•เฆŸเฆฟ เฆ•เงเฆฒเฆพเฆธ เฆ†เฆ›เง‡, เฆฏเฆพเฆฐ เฆเฆ•เฆŸเฆฟ เฆจเฆพเฆฎ เฆ†เฆ›เง‡: เฆงเฆฐเงเฆจ เฆ†เฆชเฆจเฆพเฆฐ เฆ•เฆพเฆ›เง‡ `Person` เฆจเฆพเฆฎเง‡ เฆเฆ•เฆŸเฆฟ เฆ•เงเฆฒเฆพเฆธ เฆ†เฆ›เง‡, เฆฏเฆพเฆฐ เฆเฆ•เฆŸเฆฟ เฆจเฆพเฆฎ เฆ†เฆ›เง‡:
```Python hl_lines="1-3" ```Python hl_lines="1-3"
{!../../../docs_src/python_types/tutorial010.py!} {!../../docs_src/python_types/tutorial010.py!}
``` ```
เฆคเฆพเฆฐเฆชเฆฐ เฆ†เฆชเฆจเฆฟ เฆเฆ•เฆŸเฆฟ เฆญเง‡เฆฐเฆฟเฆฏเฆผเง‡เฆฌเฆฒเฆ•เง‡ `Person` เฆŸเฆพเฆ‡เฆชเง‡เฆฐ เฆนเฆฟเฆธเง‡เฆฌเง‡ เฆ˜เง‹เฆทเฆฃเฆพ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเง‡เฆจ: เฆคเฆพเฆฐเฆชเฆฐ เฆ†เฆชเฆจเฆฟ เฆเฆ•เฆŸเฆฟ เฆญเง‡เฆฐเฆฟเฆฏเฆผเง‡เฆฌเฆฒเฆ•เง‡ `Person` เฆŸเฆพเฆ‡เฆชเง‡เฆฐ เฆนเฆฟเฆธเง‡เฆฌเง‡ เฆ˜เง‹เฆทเฆฃเฆพ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเง‡เฆจ:
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/python_types/tutorial010.py!} {!../../docs_src/python_types/tutorial010.py!}
``` ```
เฆเฆฌเฆ‚ เฆคเฆพเฆฐเฆชเฆฐ, เฆ†เฆฌเฆพเฆฐ, เฆ†เฆชเฆจเฆฟ เฆเฆกเฆฟเฆŸเฆฐ เฆธเฆพเฆชเง‹เฆฐเงเฆŸ เฆชเง‡เฆฏเฆผเง‡ เฆฏเฆพเฆฌเง‡เฆจ: เฆเฆฌเฆ‚ เฆคเฆพเฆฐเฆชเฆฐ, เฆ†เฆฌเฆพเฆฐ, เฆ†เฆชเฆจเฆฟ เฆเฆกเฆฟเฆŸเฆฐ เฆธเฆพเฆชเง‹เฆฐเงเฆŸ เฆชเง‡เฆฏเฆผเง‡ เฆฏเฆพเฆฌเง‡เฆจ:
@ -486,7 +486,7 @@ Python 3.10-เฆ, `Union` เฆเฆฌเฆ‚ `Optional` เฆœเง‡เฆจเง‡เฆฐเฆฟเฆ•เฆธ เฆฌเงเฆฏ
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python ```Python
{!> ../../../docs_src/python_types/tutorial011_py310.py!} {!> ../../docs_src/python_types/tutorial011_py310.py!}
``` ```
//// ////
@ -494,7 +494,7 @@ Python 3.10-เฆ, `Union` เฆเฆฌเฆ‚ `Optional` เฆœเง‡เฆจเง‡เฆฐเฆฟเฆ•เฆธ เฆฌเงเฆฏ
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python ```Python
{!> ../../../docs_src/python_types/tutorial011_py39.py!} {!> ../../docs_src/python_types/tutorial011_py39.py!}
``` ```
//// ////
@ -502,7 +502,7 @@ Python 3.10-เฆ, `Union` เฆเฆฌเฆ‚ `Optional` เฆœเง‡เฆจเง‡เฆฐเฆฟเฆ•เฆธ เฆฌเงเฆฏ
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python ```Python
{!> ../../../docs_src/python_types/tutorial011.py!} {!> ../../docs_src/python_types/tutorial011.py!}
``` ```
//// ////
@ -532,7 +532,7 @@ Python-เฆ เฆเฆฎเฆจ เฆเฆ•เฆŸเฆฟ เฆซเฆฟเฆšเฆพเฆฐ เฆ†เฆ›เง‡ เฆฏเฆพ `Annotated`
Python 3.9-เฆ, `Annotated` เฆธเงเฆŸเงเฆฏเฆพเฆจเงเฆกเฆพเฆฐเงเฆก เฆฒเฆพเฆ‡เฆฌเงเฆฐเง‡เฆฐเฆฟเฆคเง‡ เฆ…เฆจเงเฆคเฆฐเงเฆญเงเฆ•เงเฆค, เฆคเฆพเฆ‡ เฆ†เฆชเฆจเฆฟ เฆเฆŸเฆฟ `typing` เฆฅเง‡เฆ•เง‡ เฆ‡เฆฎเฆชเง‹เฆฐเงเฆŸ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเง‡เฆจเฅค Python 3.9-เฆ, `Annotated` เฆธเงเฆŸเงเฆฏเฆพเฆจเงเฆกเฆพเฆฐเงเฆก เฆฒเฆพเฆ‡เฆฌเงเฆฐเง‡เฆฐเฆฟเฆคเง‡ เฆ…เฆจเงเฆคเฆฐเงเฆญเงเฆ•เงเฆค, เฆคเฆพเฆ‡ เฆ†เฆชเฆจเฆฟ เฆเฆŸเฆฟ `typing` เฆฅเง‡เฆ•เง‡ เฆ‡เฆฎเฆชเง‹เฆฐเงเฆŸ เฆ•เฆฐเฆคเง‡ เฆชเฆพเฆฐเง‡เฆจเฅค
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial013_py39.py!} {!> ../../docs_src/python_types/tutorial013_py39.py!}
``` ```
//// ////
@ -544,7 +544,7 @@ Python 3.9-เฆเฆฐ เฆจเง€เฆšเง‡เฆฐ เฆธเฆ‚เฆธเงเฆ•เฆฐเฆฃเฆ—เงเฆฒเฆฟเฆคเง‡, เฆ†
เฆเฆŸเฆฟ **FastAPI** เฆเฆฐ เฆธเฆพเฆฅเง‡ เฆ‡เฆคเฆฟเฆฎเฆฆเงเฆงเง‡ เฆ‡เฆจเฆธเงเฆŸเฆฒ เฆนเฆฏเฆผเง‡ เฆฅเฆพเฆ•เฆฌเง‡เฅค เฆเฆŸเฆฟ **FastAPI** เฆเฆฐ เฆธเฆพเฆฅเง‡ เฆ‡เฆคเฆฟเฆฎเฆฆเงเฆงเง‡ เฆ‡เฆจเฆธเงเฆŸเฆฒ เฆนเฆฏเฆผเง‡ เฆฅเฆพเฆ•เฆฌเง‡เฅค
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial013.py!} {!> ../../docs_src/python_types/tutorial013.py!}
``` ```
//// ////

8
docs/de/docs/advanced/additional-responses.md

@ -27,7 +27,7 @@ Jedes dieser Response-`dict`s kann einen Schlรผssel `model` haben, welcher ein P
Um beispielsweise eine weitere Response mit dem Statuscode `404` und einem Pydantic-Modell `Message` zu deklarieren, kรถnnen Sie schreiben: Um beispielsweise eine weitere Response mit dem Statuscode `404` und einem Pydantic-Modell `Message` zu deklarieren, kรถnnen Sie schreiben:
```Python hl_lines="18 22" ```Python hl_lines="18 22"
{!../../../docs_src/additional_responses/tutorial001.py!} {!../../docs_src/additional_responses/tutorial001.py!}
``` ```
/// note | "Hinweis" /// note | "Hinweis"
@ -178,7 +178,7 @@ Sie kรถnnen denselben `responses`-Parameter verwenden, um verschiedene Medientyp
Sie kรถnnen beispielsweise einen zusรคtzlichen Medientyp `image/png` hinzufรผgen und damit deklarieren, dass Ihre *Pfadoperation* ein JSON-Objekt (mit dem Medientyp `application/json`) oder ein PNG-Bild zurรผckgeben kann: Sie kรถnnen beispielsweise einen zusรคtzlichen Medientyp `image/png` hinzufรผgen und damit deklarieren, dass Ihre *Pfadoperation* ein JSON-Objekt (mit dem Medientyp `application/json`) oder ein PNG-Bild zurรผckgeben kann:
```Python hl_lines="19-24 28" ```Python hl_lines="19-24 28"
{!../../../docs_src/additional_responses/tutorial002.py!} {!../../docs_src/additional_responses/tutorial002.py!}
``` ```
/// note | "Hinweis" /// note | "Hinweis"
@ -208,7 +208,7 @@ Sie kรถnnen beispielsweise eine Response mit dem Statuscode `404` deklarieren, d
Und eine Response mit dem Statuscode `200`, die Ihr `response_model` verwendet, aber ein benutzerdefiniertes Beispiel (`example`) enthรคlt: Und eine Response mit dem Statuscode `200`, die Ihr `response_model` verwendet, aber ein benutzerdefiniertes Beispiel (`example`) enthรคlt:
```Python hl_lines="20-31" ```Python hl_lines="20-31"
{!../../../docs_src/additional_responses/tutorial003.py!} {!../../docs_src/additional_responses/tutorial003.py!}
``` ```
Es wird alles kombiniert und in Ihre OpenAPI eingebunden und in der API-Dokumentation angezeigt: Es wird alles kombiniert und in Ihre OpenAPI eingebunden und in der API-Dokumentation angezeigt:
@ -244,7 +244,7 @@ Mit dieser Technik kรถnnen Sie einige vordefinierte Responses in Ihren *Pfadoper
Zum Beispiel: Zum Beispiel:
```Python hl_lines="13-17 26" ```Python hl_lines="13-17 26"
{!../../../docs_src/additional_responses/tutorial004.py!} {!../../docs_src/additional_responses/tutorial004.py!}
``` ```
## Weitere Informationen zu OpenAPI-Responses ## Weitere Informationen zu OpenAPI-Responses

10
docs/de/docs/advanced/additional-status-codes.md

@ -17,7 +17,7 @@ Um dies zu erreichen, importieren Sie `JSONResponse`, und geben Sie Ihren Inhalt
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="4 25" ```Python hl_lines="4 25"
{!> ../../../docs_src/additional_status_codes/tutorial001_an_py310.py!} {!> ../../docs_src/additional_status_codes/tutorial001_an_py310.py!}
``` ```
//// ////
@ -25,7 +25,7 @@ Um dies zu erreichen, importieren Sie `JSONResponse`, und geben Sie Ihren Inhalt
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="4 25" ```Python hl_lines="4 25"
{!> ../../../docs_src/additional_status_codes/tutorial001_an_py39.py!} {!> ../../docs_src/additional_status_codes/tutorial001_an_py39.py!}
``` ```
//// ////
@ -33,7 +33,7 @@ Um dies zu erreichen, importieren Sie `JSONResponse`, und geben Sie Ihren Inhalt
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="4 26" ```Python hl_lines="4 26"
{!> ../../../docs_src/additional_status_codes/tutorial001_an.py!} {!> ../../docs_src/additional_status_codes/tutorial001_an.py!}
``` ```
//// ////
@ -47,7 +47,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="2 23" ```Python hl_lines="2 23"
{!> ../../../docs_src/additional_status_codes/tutorial001_py310.py!} {!> ../../docs_src/additional_status_codes/tutorial001_py310.py!}
``` ```
//// ////
@ -61,7 +61,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="4 25" ```Python hl_lines="4 25"
{!> ../../../docs_src/additional_status_codes/tutorial001.py!} {!> ../../docs_src/additional_status_codes/tutorial001.py!}
``` ```
//// ////

24
docs/de/docs/advanced/advanced-dependencies.md

@ -21,7 +21,7 @@ Dazu deklarieren wir eine Methode `__call__`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/dependencies/tutorial011_an_py39.py!} {!> ../../docs_src/dependencies/tutorial011_an_py39.py!}
``` ```
//// ////
@ -29,7 +29,7 @@ Dazu deklarieren wir eine Methode `__call__`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/dependencies/tutorial011_an.py!} {!> ../../docs_src/dependencies/tutorial011_an.py!}
``` ```
//// ////
@ -43,7 +43,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/dependencies/tutorial011.py!} {!> ../../docs_src/dependencies/tutorial011.py!}
``` ```
//// ////
@ -57,7 +57,7 @@ Und jetzt kรถnnen wir `__init__` verwenden, um die Parameter der Instanz zu dekl
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/dependencies/tutorial011_an_py39.py!} {!> ../../docs_src/dependencies/tutorial011_an_py39.py!}
``` ```
//// ////
@ -65,7 +65,7 @@ Und jetzt kรถnnen wir `__init__` verwenden, um die Parameter der Instanz zu dekl
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/dependencies/tutorial011_an.py!} {!> ../../docs_src/dependencies/tutorial011_an.py!}
``` ```
//// ////
@ -79,7 +79,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/dependencies/tutorial011.py!} {!> ../../docs_src/dependencies/tutorial011.py!}
``` ```
//// ////
@ -93,7 +93,7 @@ Wir kรถnnten eine Instanz dieser Klasse erstellen mit:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/dependencies/tutorial011_an_py39.py!} {!> ../../docs_src/dependencies/tutorial011_an_py39.py!}
``` ```
//// ////
@ -101,7 +101,7 @@ Wir kรถnnten eine Instanz dieser Klasse erstellen mit:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="17" ```Python hl_lines="17"
{!> ../../../docs_src/dependencies/tutorial011_an.py!} {!> ../../docs_src/dependencies/tutorial011_an.py!}
``` ```
//// ////
@ -115,7 +115,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="16" ```Python hl_lines="16"
{!> ../../../docs_src/dependencies/tutorial011.py!} {!> ../../docs_src/dependencies/tutorial011.py!}
``` ```
//// ////
@ -137,7 +137,7 @@ checker(q="somequery")
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="22" ```Python hl_lines="22"
{!> ../../../docs_src/dependencies/tutorial011_an_py39.py!} {!> ../../docs_src/dependencies/tutorial011_an_py39.py!}
``` ```
//// ////
@ -145,7 +145,7 @@ checker(q="somequery")
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="21" ```Python hl_lines="21"
{!> ../../../docs_src/dependencies/tutorial011_an.py!} {!> ../../docs_src/dependencies/tutorial011_an.py!}
``` ```
//// ////
@ -159,7 +159,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/dependencies/tutorial011.py!} {!> ../../docs_src/dependencies/tutorial011.py!}
``` ```
//// ////

8
docs/de/docs/advanced/async-tests.md

@ -33,13 +33,13 @@ Betrachten wir als einfaches Beispiel eine Dateistruktur รคhnlich der in [GrรถรŸ
Die Datei `main.py` hรคtte als Inhalt: Die Datei `main.py` hรคtte als Inhalt:
```Python ```Python
{!../../../docs_src/async_tests/main.py!} {!../../docs_src/async_tests/main.py!}
``` ```
Die Datei `test_main.py` hรคtte die Tests fรผr `main.py`, das kรถnnte jetzt so aussehen: Die Datei `test_main.py` hรคtte die Tests fรผr `main.py`, das kรถnnte jetzt so aussehen:
```Python ```Python
{!../../../docs_src/async_tests/test_main.py!} {!../../docs_src/async_tests/test_main.py!}
``` ```
## Es ausfรผhren ## Es ausfรผhren
@ -61,7 +61,7 @@ $ pytest
Der Marker `@pytest.mark.anyio` teilt pytest mit, dass diese Testfunktion asynchron aufgerufen werden soll: Der Marker `@pytest.mark.anyio` teilt pytest mit, dass diese Testfunktion asynchron aufgerufen werden soll:
```Python hl_lines="7" ```Python hl_lines="7"
{!../../../docs_src/async_tests/test_main.py!} {!../../docs_src/async_tests/test_main.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -73,7 +73,7 @@ Beachten Sie, dass die Testfunktion jetzt `async def` ist und nicht nur `def` wi
Dann kรถnnen wir einen `AsyncClient` mit der App erstellen und mit `await` asynchrone Requests an ihn senden. Dann kรถnnen wir einen `AsyncClient` mit der App erstellen und mit `await` asynchrone Requests an ihn senden.
```Python hl_lines="9-12" ```Python hl_lines="9-12"
{!../../../docs_src/async_tests/test_main.py!} {!../../docs_src/async_tests/test_main.py!}
``` ```
Das ist das ร„quivalent zu: Das ist das ร„quivalent zu:

10
docs/de/docs/advanced/behind-a-proxy.md

@ -19,7 +19,7 @@ In diesem Fall wรผrde der ursprรผngliche Pfad `/app` tatsรคchlich unter `/api/v1
Auch wenn Ihr gesamter Code unter der Annahme geschrieben ist, dass es nur `/app` gibt. Auch wenn Ihr gesamter Code unter der Annahme geschrieben ist, dass es nur `/app` gibt.
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/behind_a_proxy/tutorial001.py!} {!../../docs_src/behind_a_proxy/tutorial001.py!}
``` ```
Und der Proxy wรผrde das **Pfadprรคfix** on-the-fly **"entfernen**", bevor er die Anfrage an Uvicorn รผbermittelt, dafรผr sorgend, dass Ihre Anwendung davon รผberzeugt ist, dass sie unter `/app` bereitgestellt wird, sodass Sie nicht Ihren gesamten Code dahingehend aktualisieren mรผssen, das Prรคfix `/api/v1` zu verwenden. Und der Proxy wรผrde das **Pfadprรคfix** on-the-fly **"entfernen**", bevor er die Anfrage an Uvicorn รผbermittelt, dafรผr sorgend, dass Ihre Anwendung davon รผberzeugt ist, dass sie unter `/app` bereitgestellt wird, sodass Sie nicht Ihren gesamten Code dahingehend aktualisieren mรผssen, das Prรคfix `/api/v1` zu verwenden.
@ -99,7 +99,7 @@ Sie kรถnnen den aktuellen `root_path` abrufen, der von Ihrer Anwendung fรผr jede
Hier fรผgen wir ihn, nur zu Demonstrationszwecken, in die Nachricht ein. Hier fรผgen wir ihn, nur zu Demonstrationszwecken, in die Nachricht ein.
```Python hl_lines="8" ```Python hl_lines="8"
{!../../../docs_src/behind_a_proxy/tutorial001.py!} {!../../docs_src/behind_a_proxy/tutorial001.py!}
``` ```
Wenn Sie Uvicorn dann starten mit: Wenn Sie Uvicorn dann starten mit:
@ -128,7 +128,7 @@ wรคre die Response etwa:
Falls Sie keine Mรถglichkeit haben, eine Kommandozeilenoption wie `--root-path` oder รคhnlich zu รผbergeben, kรถnnen Sie als Alternative beim Erstellen Ihrer FastAPI-Anwendung den Parameter `root_path` setzen: Falls Sie keine Mรถglichkeit haben, eine Kommandozeilenoption wie `--root-path` oder รคhnlich zu รผbergeben, kรถnnen Sie als Alternative beim Erstellen Ihrer FastAPI-Anwendung den Parameter `root_path` setzen:
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/behind_a_proxy/tutorial002.py!} {!../../docs_src/behind_a_proxy/tutorial002.py!}
``` ```
Die รœbergabe des `root_path` an `FastAPI` wรคre das ร„quivalent zur รœbergabe der `--root-path`-Kommandozeilenoption an Uvicorn oder Hypercorn. Die รœbergabe des `root_path` an `FastAPI` wรคre das ร„quivalent zur รœbergabe der `--root-path`-Kommandozeilenoption an Uvicorn oder Hypercorn.
@ -310,7 +310,7 @@ Wenn Sie eine benutzerdefinierte Liste von Servern (`servers`) รผbergeben und es
Zum Beispiel: Zum Beispiel:
```Python hl_lines="4-7" ```Python hl_lines="4-7"
{!../../../docs_src/behind_a_proxy/tutorial003.py!} {!../../docs_src/behind_a_proxy/tutorial003.py!}
``` ```
Erzeugt ein OpenAPI-Schema, wie: Erzeugt ein OpenAPI-Schema, wie:
@ -359,7 +359,7 @@ Die Dokumentationsoberflรคche interagiert mit dem von Ihnen ausgewรคhlten Server
Wenn Sie nicht mรถchten, dass **FastAPI** einen automatischen Server inkludiert, welcher `root_path` verwendet, kรถnnen Sie den Parameter `root_path_in_servers=False` verwenden: Wenn Sie nicht mรถchten, dass **FastAPI** einen automatischen Server inkludiert, welcher `root_path` verwendet, kรถnnen Sie den Parameter `root_path_in_servers=False` verwenden:
```Python hl_lines="9" ```Python hl_lines="9"
{!../../../docs_src/behind_a_proxy/tutorial004.py!} {!../../docs_src/behind_a_proxy/tutorial004.py!}
``` ```
Dann wird er nicht in das OpenAPI-Schema aufgenommen. Dann wird er nicht in das OpenAPI-Schema aufgenommen.

32
docs/de/docs/advanced/custom-response.md

@ -31,7 +31,7 @@ Das liegt daran, dass FastAPI standardmรครŸig jedes enthaltene Element รผberprรผ
Wenn Sie jedoch sicher sind, dass der von Ihnen zurรผckgegebene Inhalt **mit JSON serialisierbar** ist, kรถnnen Sie ihn direkt an die Response-Klasse รผbergeben und die zusรคtzliche Arbeit vermeiden, die FastAPI hรคtte, indem es Ihren zurรผckgegebenen Inhalt durch den `jsonable_encoder` leitet, bevor es ihn an die Response-Klasse รผbergibt. Wenn Sie jedoch sicher sind, dass der von Ihnen zurรผckgegebene Inhalt **mit JSON serialisierbar** ist, kรถnnen Sie ihn direkt an die Response-Klasse รผbergeben und die zusรคtzliche Arbeit vermeiden, die FastAPI hรคtte, indem es Ihren zurรผckgegebenen Inhalt durch den `jsonable_encoder` leitet, bevor es ihn an die Response-Klasse รผbergibt.
```Python hl_lines="2 7" ```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial001b.py!} {!../../docs_src/custom_response/tutorial001b.py!}
``` ```
/// info /// info
@ -58,7 +58,7 @@ Um eine Response mit HTML direkt von **FastAPI** zurรผckzugeben, verwenden Sie `
* รœbergeben Sie `HTMLResponse` als den Parameter `response_class` Ihres *Pfadoperation-Dekorators*. * รœbergeben Sie `HTMLResponse` als den Parameter `response_class` Ihres *Pfadoperation-Dekorators*.
```Python hl_lines="2 7" ```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial002.py!} {!../../docs_src/custom_response/tutorial002.py!}
``` ```
/// info /// info
@ -78,7 +78,7 @@ Wie in [Eine Response direkt zurรผckgeben](response-directly.md){.internal-link
Das gleiche Beispiel von oben, das eine `HTMLResponse` zurรผckgibt, kรถnnte so aussehen: Das gleiche Beispiel von oben, das eine `HTMLResponse` zurรผckgibt, kรถnnte so aussehen:
```Python hl_lines="2 7 19" ```Python hl_lines="2 7 19"
{!../../../docs_src/custom_response/tutorial003.py!} {!../../docs_src/custom_response/tutorial003.py!}
``` ```
/// warning | "Achtung" /// warning | "Achtung"
@ -104,7 +104,7 @@ Die `response_class` wird dann nur zur Dokumentation der OpenAPI-Pfadoperation*
Es kรถnnte zum Beispiel so etwas sein: Es kรถnnte zum Beispiel so etwas sein:
```Python hl_lines="7 21 23" ```Python hl_lines="7 21 23"
{!../../../docs_src/custom_response/tutorial004.py!} {!../../docs_src/custom_response/tutorial004.py!}
``` ```
In diesem Beispiel generiert die Funktion `generate_html_response()` bereits eine `Response` und gibt sie zurรผck, anstatt das HTML in einem `str` zurรผckzugeben. In diesem Beispiel generiert die Funktion `generate_html_response()` bereits eine `Response` und gibt sie zurรผck, anstatt das HTML in einem `str` zurรผckzugeben.
@ -145,7 +145,7 @@ Sie akzeptiert die folgenden Parameter:
FastAPI (eigentlich Starlette) fรผgt automatisch einen Content-Length-Header ein. AuรŸerdem wird es einen Content-Type-Header einfรผgen, der auf dem media_type basiert, und fรผr Texttypen einen Zeichensatz (charset) anfรผgen. FastAPI (eigentlich Starlette) fรผgt automatisch einen Content-Length-Header ein. AuรŸerdem wird es einen Content-Type-Header einfรผgen, der auf dem media_type basiert, und fรผr Texttypen einen Zeichensatz (charset) anfรผgen.
```Python hl_lines="1 18" ```Python hl_lines="1 18"
{!../../../docs_src/response_directly/tutorial002.py!} {!../../docs_src/response_directly/tutorial002.py!}
``` ```
### `HTMLResponse` ### `HTMLResponse`
@ -157,7 +157,7 @@ Nimmt Text oder Bytes entgegen und gibt eine HTML-Response zurรผck, wie Sie oben
Nimmt Text oder Bytes entgegen und gibt eine Plain-Text-Response zurรผck. Nimmt Text oder Bytes entgegen und gibt eine Plain-Text-Response zurรผck.
```Python hl_lines="2 7 9" ```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial005.py!} {!../../docs_src/custom_response/tutorial005.py!}
``` ```
### `JSONResponse` ### `JSONResponse`
@ -181,7 +181,7 @@ Eine alternative JSON-Response mit <a href="https://github.com/ultrajson/ultrajs
/// ///
```Python hl_lines="2 7" ```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial001.py!} {!../../docs_src/custom_response/tutorial001.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -197,7 +197,7 @@ Gibt eine HTTP-Weiterleitung (HTTP-Redirect) zurรผck. Verwendet standardmรครŸig
Sie kรถnnen eine `RedirectResponse` direkt zurรผckgeben: Sie kรถnnen eine `RedirectResponse` direkt zurรผckgeben:
```Python hl_lines="2 9" ```Python hl_lines="2 9"
{!../../../docs_src/custom_response/tutorial006.py!} {!../../docs_src/custom_response/tutorial006.py!}
``` ```
--- ---
@ -206,7 +206,7 @@ Oder Sie kรถnnen sie im Parameter `response_class` verwenden:
```Python hl_lines="2 7 9" ```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial006b.py!} {!../../docs_src/custom_response/tutorial006b.py!}
``` ```
Wenn Sie das tun, kรถnnen Sie die URL direkt von Ihrer *Pfadoperation*-Funktion zurรผckgeben. Wenn Sie das tun, kรถnnen Sie die URL direkt von Ihrer *Pfadoperation*-Funktion zurรผckgeben.
@ -218,7 +218,7 @@ In diesem Fall ist der verwendete `status_code` der Standardcode fรผr die `Redir
Sie kรถnnen den Parameter `status_code` auch in Kombination mit dem Parameter `response_class` verwenden: Sie kรถnnen den Parameter `status_code` auch in Kombination mit dem Parameter `response_class` verwenden:
```Python hl_lines="2 7 9" ```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial006c.py!} {!../../docs_src/custom_response/tutorial006c.py!}
``` ```
### `StreamingResponse` ### `StreamingResponse`
@ -226,7 +226,7 @@ Sie kรถnnen den Parameter `status_code` auch in Kombination mit dem Parameter `r
Nimmt einen asynchronen Generator oder einen normalen Generator/Iterator und streamt den Responsebody. Nimmt einen asynchronen Generator oder einen normalen Generator/Iterator und streamt den Responsebody.
```Python hl_lines="2 14" ```Python hl_lines="2 14"
{!../../../docs_src/custom_response/tutorial007.py!} {!../../docs_src/custom_response/tutorial007.py!}
``` ```
#### Verwendung von `StreamingResponse` mit dateiรคhnlichen Objekten #### Verwendung von `StreamingResponse` mit dateiรคhnlichen Objekten
@ -238,7 +238,7 @@ Auf diese Weise mรผssen Sie nicht alles zuerst in den Arbeitsspeicher lesen und
Das umfasst viele Bibliotheken zur Interaktion mit Cloud-Speicher, Videoverarbeitung und anderen. Das umfasst viele Bibliotheken zur Interaktion mit Cloud-Speicher, Videoverarbeitung und anderen.
```{ .python .annotate hl_lines="2 10-12 14" } ```{ .python .annotate hl_lines="2 10-12 14" }
{!../../../docs_src/custom_response/tutorial008.py!} {!../../docs_src/custom_response/tutorial008.py!}
``` ```
1. Das ist die Generatorfunktion. Es handelt sich um eine โ€žGeneratorfunktionโ€œ, da sie `yield`-Anweisungen enthรคlt. 1. Das ist die Generatorfunktion. Es handelt sich um eine โ€žGeneratorfunktionโ€œ, da sie `yield`-Anweisungen enthรคlt.
@ -269,13 +269,13 @@ Nimmt zur Instanziierung einen anderen Satz von Argumenten entgegen als die ande
Datei-Responses enthalten die entsprechenden `Content-Length`-, `Last-Modified`- und `ETag`-Header. Datei-Responses enthalten die entsprechenden `Content-Length`-, `Last-Modified`- und `ETag`-Header.
```Python hl_lines="2 10" ```Python hl_lines="2 10"
{!../../../docs_src/custom_response/tutorial009.py!} {!../../docs_src/custom_response/tutorial009.py!}
``` ```
Sie kรถnnen auch den Parameter `response_class` verwenden: Sie kรถnnen auch den Parameter `response_class` verwenden:
```Python hl_lines="2 8 10" ```Python hl_lines="2 8 10"
{!../../../docs_src/custom_response/tutorial009b.py!} {!../../docs_src/custom_response/tutorial009b.py!}
``` ```
In diesem Fall kรถnnen Sie den Dateipfad direkt von Ihrer *Pfadoperation*-Funktion zurรผckgeben. In diesem Fall kรถnnen Sie den Dateipfad direkt von Ihrer *Pfadoperation*-Funktion zurรผckgeben.
@ -291,7 +291,7 @@ Sie mรถchten etwa, dass Ihre Response eingerรผcktes und formatiertes JSON zurรผc
Sie kรถnnten eine `CustomORJSONResponse` erstellen. Das Wichtigste, was Sie tun mรผssen, ist, eine `Response.render(content)`-Methode zu erstellen, die den Inhalt als `bytes` zurรผckgibt: Sie kรถnnten eine `CustomORJSONResponse` erstellen. Das Wichtigste, was Sie tun mรผssen, ist, eine `Response.render(content)`-Methode zu erstellen, die den Inhalt als `bytes` zurรผckgibt:
```Python hl_lines="9-14 17" ```Python hl_lines="9-14 17"
{!../../../docs_src/custom_response/tutorial009c.py!} {!../../docs_src/custom_response/tutorial009c.py!}
``` ```
Statt: Statt:
@ -319,7 +319,7 @@ Der Parameter, der das definiert, ist `default_response_class`.
Im folgenden Beispiel verwendet **FastAPI** standardmรครŸig `ORJSONResponse` in allen *Pfadoperationen*, anstelle von `JSONResponse`. Im folgenden Beispiel verwendet **FastAPI** standardmรครŸig `ORJSONResponse` in allen *Pfadoperationen*, anstelle von `JSONResponse`.
```Python hl_lines="2 4" ```Python hl_lines="2 4"
{!../../../docs_src/custom_response/tutorial010.py!} {!../../docs_src/custom_response/tutorial010.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"

6
docs/de/docs/advanced/dataclasses.md

@ -5,7 +5,7 @@ FastAPI basiert auf **Pydantic** und ich habe Ihnen gezeigt, wie Sie Pydantic-Mo
Aber FastAPI unterstรผtzt auf die gleiche Weise auch die Verwendung von <a href="https://docs.python.org/3/library/dataclasses.html" class="external-link" target="_blank">`dataclasses`</a>: Aber FastAPI unterstรผtzt auf die gleiche Weise auch die Verwendung von <a href="https://docs.python.org/3/library/dataclasses.html" class="external-link" target="_blank">`dataclasses`</a>:
```Python hl_lines="1 7-12 19-20" ```Python hl_lines="1 7-12 19-20"
{!../../../docs_src/dataclasses/tutorial001.py!} {!../../docs_src/dataclasses/tutorial001.py!}
``` ```
Das ist dank **Pydantic** ebenfalls mรถglich, da es <a href="https://pydantic-docs.helpmanual.io/usage/dataclasses/#use-of-stdlib-dataclasses-with-basemodel" class="external-link" target="_blank">`dataclasses` intern unterstรผtzt</a>. Das ist dank **Pydantic** ebenfalls mรถglich, da es <a href="https://pydantic-docs.helpmanual.io/usage/dataclasses/#use-of-stdlib-dataclasses-with-basemodel" class="external-link" target="_blank">`dataclasses` intern unterstรผtzt</a>.
@ -35,7 +35,7 @@ Wenn Sie jedoch eine Menge Datenklassen herumliegen haben, ist dies ein guter Tr
Sie kรถnnen `dataclasses` auch im Parameter `response_model` verwenden: Sie kรถnnen `dataclasses` auch im Parameter `response_model` verwenden:
```Python hl_lines="1 7-13 19" ```Python hl_lines="1 7-13 19"
{!../../../docs_src/dataclasses/tutorial002.py!} {!../../docs_src/dataclasses/tutorial002.py!}
``` ```
Die Datenklasse wird automatisch in eine Pydantic-Datenklasse konvertiert. Die Datenklasse wird automatisch in eine Pydantic-Datenklasse konvertiert.
@ -53,7 +53,7 @@ In einigen Fรคllen mรผssen Sie mรถglicherweise immer noch Pydantics Version von
In diesem Fall kรถnnen Sie einfach die Standard-`dataclasses` durch `pydantic.dataclasses` ersetzen, was einen direkten Ersatz darstellt: In diesem Fall kรถnnen Sie einfach die Standard-`dataclasses` durch `pydantic.dataclasses` ersetzen, was einen direkten Ersatz darstellt:
```{ .python .annotate hl_lines="1 5 8-11 14-17 23-25 28" } ```{ .python .annotate hl_lines="1 5 8-11 14-17 23-25 28" }
{!../../../docs_src/dataclasses/tutorial003.py!} {!../../docs_src/dataclasses/tutorial003.py!}
``` ```
1. Wir importieren `field` weiterhin von Standard-`dataclasses`. 1. Wir importieren `field` weiterhin von Standard-`dataclasses`.

12
docs/de/docs/advanced/events.md

@ -31,7 +31,7 @@ Beginnen wir mit einem Beispiel und sehen es uns dann im Detail an.
Wir erstellen eine asynchrone Funktion `lifespan()` mit `yield` wie folgt: Wir erstellen eine asynchrone Funktion `lifespan()` mit `yield` wie folgt:
```Python hl_lines="16 19" ```Python hl_lines="16 19"
{!../../../docs_src/events/tutorial003.py!} {!../../docs_src/events/tutorial003.py!}
``` ```
Hier simulieren wir das langsame *Hochfahren*, das Laden des Modells, indem wir die (Fake-)Modellfunktion vor dem `yield` in das Dictionary mit Modellen fรผr maschinelles Lernen einfรผgen. Dieser Code wird ausgefรผhrt, **bevor** die Anwendung **beginnt, Requests entgegenzunehmen**, wรคhrend des *Hochfahrens*. Hier simulieren wir das langsame *Hochfahren*, das Laden des Modells, indem wir die (Fake-)Modellfunktion vor dem `yield` in das Dictionary mit Modellen fรผr maschinelles Lernen einfรผgen. Dieser Code wird ausgefรผhrt, **bevor** die Anwendung **beginnt, Requests entgegenzunehmen**, wรคhrend des *Hochfahrens*.
@ -51,7 +51,7 @@ Mรถglicherweise mรผssen Sie eine neue Version starten, oder Sie haben es einfach
Das Erste, was auffรคllt, ist, dass wir eine asynchrone Funktion mit `yield` definieren. Das ist sehr รคhnlich zu Abhรคngigkeiten mit `yield`. Das Erste, was auffรคllt, ist, dass wir eine asynchrone Funktion mit `yield` definieren. Das ist sehr รคhnlich zu Abhรคngigkeiten mit `yield`.
```Python hl_lines="14-19" ```Python hl_lines="14-19"
{!../../../docs_src/events/tutorial003.py!} {!../../docs_src/events/tutorial003.py!}
``` ```
Der erste Teil der Funktion, vor dem `yield`, wird ausgefรผhrt **bevor** die Anwendung startet. Der erste Teil der Funktion, vor dem `yield`, wird ausgefรผhrt **bevor** die Anwendung startet.
@ -65,7 +65,7 @@ Wie Sie sehen, ist die Funktion mit einem `@asynccontextmanager` versehen.
Dadurch wird die Funktion in einen sogenannten โ€ž**asynchronen Kontextmanager**โ€œ umgewandelt. Dadurch wird die Funktion in einen sogenannten โ€ž**asynchronen Kontextmanager**โ€œ umgewandelt.
```Python hl_lines="1 13" ```Python hl_lines="1 13"
{!../../../docs_src/events/tutorial003.py!} {!../../docs_src/events/tutorial003.py!}
``` ```
Ein **Kontextmanager** in Python ist etwas, das Sie in einer `with`-Anweisung verwenden kรถnnen, zum Beispiel kann `open()` als Kontextmanager verwendet werden: Ein **Kontextmanager** in Python ist etwas, das Sie in einer `with`-Anweisung verwenden kรถnnen, zum Beispiel kann `open()` als Kontextmanager verwendet werden:
@ -89,7 +89,7 @@ In unserem obigen Codebeispiel verwenden wir ihn nicht direkt, sondern รผbergebe
Der Parameter `lifespan` der `FastAPI`-App benรถtigt einen **asynchronen Kontextmanager**, wir kรถnnen ihm also unseren neuen asynchronen Kontextmanager `lifespan` รผbergeben. Der Parameter `lifespan` der `FastAPI`-App benรถtigt einen **asynchronen Kontextmanager**, wir kรถnnen ihm also unseren neuen asynchronen Kontextmanager `lifespan` รผbergeben.
```Python hl_lines="22" ```Python hl_lines="22"
{!../../../docs_src/events/tutorial003.py!} {!../../docs_src/events/tutorial003.py!}
``` ```
## Alternative Events (deprecated) ## Alternative Events (deprecated)
@ -113,7 +113,7 @@ Diese Funktionen kรถnnen mit `async def` oder normalem `def` deklariert werden.
Um eine Funktion hinzuzufรผgen, die vor dem Start der Anwendung ausgefรผhrt werden soll, deklarieren Sie diese mit dem Event `startup`: Um eine Funktion hinzuzufรผgen, die vor dem Start der Anwendung ausgefรผhrt werden soll, deklarieren Sie diese mit dem Event `startup`:
```Python hl_lines="8" ```Python hl_lines="8"
{!../../../docs_src/events/tutorial001.py!} {!../../docs_src/events/tutorial001.py!}
``` ```
In diesem Fall initialisiert die Eventhandler-Funktion `startup` die โ€žDatenbankโ€œ der Items (nur ein `dict`) mit einigen Werten. In diesem Fall initialisiert die Eventhandler-Funktion `startup` die โ€žDatenbankโ€œ der Items (nur ein `dict`) mit einigen Werten.
@ -127,7 +127,7 @@ Und Ihre Anwendung empfรคngt erst dann Anfragen, wenn alle `startup`-Eventhandle
Um eine Funktion hinzuzufรผgen, die beim Herunterfahren der Anwendung ausgefรผhrt werden soll, deklarieren Sie sie mit dem Event `shutdown`: Um eine Funktion hinzuzufรผgen, die beim Herunterfahren der Anwendung ausgefรผhrt werden soll, deklarieren Sie sie mit dem Event `shutdown`:
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/events/tutorial002.py!} {!../../docs_src/events/tutorial002.py!}
``` ```
Hier schreibt die `shutdown`-Eventhandler-Funktion eine Textzeile `"Application shutdown"` in eine Datei `log.txt`. Hier schreibt die `shutdown`-Eventhandler-Funktion eine Textzeile `"Application shutdown"` in eine Datei `log.txt`.

16
docs/de/docs/advanced/generate-clients.md

@ -31,7 +31,7 @@ Beginnen wir mit einer einfachen FastAPI-Anwendung:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="7-9 12-13 16-17 21" ```Python hl_lines="7-9 12-13 16-17 21"
{!> ../../../docs_src/generate_clients/tutorial001_py39.py!} {!> ../../docs_src/generate_clients/tutorial001_py39.py!}
``` ```
//// ////
@ -39,7 +39,7 @@ Beginnen wir mit einer einfachen FastAPI-Anwendung:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9-11 14-15 18 19 23" ```Python hl_lines="9-11 14-15 18 19 23"
{!> ../../../docs_src/generate_clients/tutorial001.py!} {!> ../../docs_src/generate_clients/tutorial001.py!}
``` ```
//// ////
@ -150,7 +150,7 @@ Beispielsweise kรถnnten Sie einen Abschnitt fรผr **Items (Artikel)** und einen w
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="21 26 34" ```Python hl_lines="21 26 34"
{!> ../../../docs_src/generate_clients/tutorial002_py39.py!} {!> ../../docs_src/generate_clients/tutorial002_py39.py!}
``` ```
//// ////
@ -158,7 +158,7 @@ Beispielsweise kรถnnten Sie einen Abschnitt fรผr **Items (Artikel)** und einen w
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="23 28 36" ```Python hl_lines="23 28 36"
{!> ../../../docs_src/generate_clients/tutorial002.py!} {!> ../../docs_src/generate_clients/tutorial002.py!}
``` ```
//// ////
@ -211,7 +211,7 @@ AnschlieรŸend kรถnnen Sie diese benutzerdefinierte Funktion als Parameter `gener
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="6-7 10" ```Python hl_lines="6-7 10"
{!> ../../../docs_src/generate_clients/tutorial003_py39.py!} {!> ../../docs_src/generate_clients/tutorial003_py39.py!}
``` ```
//// ////
@ -219,7 +219,7 @@ AnschlieรŸend kรถnnen Sie diese benutzerdefinierte Funktion als Parameter `gener
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8-9 12" ```Python hl_lines="8-9 12"
{!> ../../../docs_src/generate_clients/tutorial003.py!} {!> ../../docs_src/generate_clients/tutorial003.py!}
``` ```
//// ////
@ -247,7 +247,7 @@ Wir kรถnnten das OpenAPI-JSON in eine Datei `openapi.json` herunterladen und dan
//// tab | Python //// tab | Python
```Python ```Python
{!> ../../../docs_src/generate_clients/tutorial004.py!} {!> ../../docs_src/generate_clients/tutorial004.py!}
``` ```
//// ////
@ -255,7 +255,7 @@ Wir kรถnnten das OpenAPI-JSON in eine Datei `openapi.json` herunterladen und dan
//// tab | Node.js //// tab | Node.js
```Javascript ```Javascript
{!> ../../../docs_src/generate_clients/tutorial004.js!} {!> ../../docs_src/generate_clients/tutorial004.js!}
``` ```
//// ////

6
docs/de/docs/advanced/middleware.md

@ -58,7 +58,7 @@ Erzwingt, dass alle eingehenden Requests entweder `https` oder `wss` sein mรผsse
Alle eingehenden Requests an `http` oder `ws` werden stattdessen an das sichere Schema umgeleitet. Alle eingehenden Requests an `http` oder `ws` werden stattdessen an das sichere Schema umgeleitet.
```Python hl_lines="2 6" ```Python hl_lines="2 6"
{!../../../docs_src/advanced_middleware/tutorial001.py!} {!../../docs_src/advanced_middleware/tutorial001.py!}
``` ```
## `TrustedHostMiddleware` ## `TrustedHostMiddleware`
@ -66,7 +66,7 @@ Alle eingehenden Requests an `http` oder `ws` werden stattdessen an das sichere
Erzwingt, dass alle eingehenden Requests einen korrekt gesetzten `Host`-Header haben, um sich vor HTTP-Host-Header-Angriffen zu schรผtzen. Erzwingt, dass alle eingehenden Requests einen korrekt gesetzten `Host`-Header haben, um sich vor HTTP-Host-Header-Angriffen zu schรผtzen.
```Python hl_lines="2 6-8" ```Python hl_lines="2 6-8"
{!../../../docs_src/advanced_middleware/tutorial002.py!} {!../../docs_src/advanced_middleware/tutorial002.py!}
``` ```
Die folgenden Argumente werden unterstรผtzt: Die folgenden Argumente werden unterstรผtzt:
@ -82,7 +82,7 @@ Verarbeitet GZip-Responses fรผr alle Requests, die `"gzip"` im `Accept-Encoding`
Diese Middleware verarbeitet sowohl Standard- als auch Streaming-Responses. Diese Middleware verarbeitet sowohl Standard- als auch Streaming-Responses.
```Python hl_lines="2 6" ```Python hl_lines="2 6"
{!../../../docs_src/advanced_middleware/tutorial003.py!} {!../../docs_src/advanced_middleware/tutorial003.py!}
``` ```
Die folgenden Argumente werden unterstรผtzt: Die folgenden Argumente werden unterstรผtzt:

8
docs/de/docs/advanced/openapi-callbacks.md

@ -32,7 +32,7 @@ Sie verfรผgt รผber eine *Pfadoperation*, die einen `Invoice`-Body empfรคngt, und
Dieser Teil ist ziemlich normal, der grรถรŸte Teil des Codes ist Ihnen wahrscheinlich bereits bekannt: Dieser Teil ist ziemlich normal, der grรถรŸte Teil des Codes ist Ihnen wahrscheinlich bereits bekannt:
```Python hl_lines="9-13 36-53" ```Python hl_lines="9-13 36-53"
{!../../../docs_src/openapi_callbacks/tutorial001.py!} {!../../docs_src/openapi_callbacks/tutorial001.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -93,7 +93,7 @@ Wenn Sie diese Sichtweise (des *externen Entwicklers*) vorรผbergehend รผbernehme
Erstellen Sie zunรคchst einen neuen `APIRouter`, der einen oder mehrere Callbacks enthรคlt. Erstellen Sie zunรคchst einen neuen `APIRouter`, der einen oder mehrere Callbacks enthรคlt.
```Python hl_lines="3 25" ```Python hl_lines="3 25"
{!../../../docs_src/openapi_callbacks/tutorial001.py!} {!../../docs_src/openapi_callbacks/tutorial001.py!}
``` ```
### Die Callback-*Pfadoperation* erstellen ### Die Callback-*Pfadoperation* erstellen
@ -106,7 +106,7 @@ Sie sollte wie eine normale FastAPI-*Pfadoperation* aussehen:
* Und sie kรถnnte auch eine Deklaration der Response enthalten, die zurรผckgegeben werden soll, z. B. `response_model=InvoiceEventReceived`. * Und sie kรถnnte auch eine Deklaration der Response enthalten, die zurรผckgegeben werden soll, z. B. `response_model=InvoiceEventReceived`.
```Python hl_lines="16-18 21-22 28-32" ```Python hl_lines="16-18 21-22 28-32"
{!../../../docs_src/openapi_callbacks/tutorial001.py!} {!../../docs_src/openapi_callbacks/tutorial001.py!}
``` ```
Es gibt zwei Hauptunterschiede zu einer normalen *Pfadoperation*: Es gibt zwei Hauptunterschiede zu einer normalen *Pfadoperation*:
@ -176,7 +176,7 @@ An diesem Punkt haben Sie die benรถtigte(n) *Callback-Pfadoperation(en)* (diejen
Verwenden Sie nun den Parameter `callbacks` im *Pfadoperation-Dekorator Ihrer API*, um das Attribut `.routes` (das ist eigentlich nur eine `list`e von Routen/*Pfadoperationen*) dieses Callback-Routers zu รผbergeben: Verwenden Sie nun den Parameter `callbacks` im *Pfadoperation-Dekorator Ihrer API*, um das Attribut `.routes` (das ist eigentlich nur eine `list`e von Routen/*Pfadoperationen*) dieses Callback-Routers zu รผbergeben:
```Python hl_lines="35" ```Python hl_lines="35"
{!../../../docs_src/openapi_callbacks/tutorial001.py!} {!../../docs_src/openapi_callbacks/tutorial001.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"

2
docs/de/docs/advanced/openapi-webhooks.md

@ -33,7 +33,7 @@ Webhooks sind in OpenAPI 3.1.0 und hรถher verfรผgbar und werden von FastAPI `0.9
Wenn Sie eine **FastAPI**-Anwendung erstellen, gibt es ein `webhooks`-Attribut, mit dem Sie *Webhooks* definieren kรถnnen, genauso wie Sie *Pfadoperationen* definieren wรผrden, zum Beispiel mit `@app.webhooks.post()`. Wenn Sie eine **FastAPI**-Anwendung erstellen, gibt es ein `webhooks`-Attribut, mit dem Sie *Webhooks* definieren kรถnnen, genauso wie Sie *Pfadoperationen* definieren wรผrden, zum Beispiel mit `@app.webhooks.post()`.
```Python hl_lines="9-13 36-53" ```Python hl_lines="9-13 36-53"
{!../../../docs_src/openapi_webhooks/tutorial001.py!} {!../../docs_src/openapi_webhooks/tutorial001.py!}
``` ```
Die von Ihnen definierten Webhooks landen im **OpenAPI**-Schema und der automatischen **Dokumentations-Oberflรคche**. Die von Ihnen definierten Webhooks landen im **OpenAPI**-Schema und der automatischen **Dokumentations-Oberflรคche**.

20
docs/de/docs/advanced/path-operation-advanced-configuration.md

@ -13,7 +13,7 @@ Mit dem Parameter `operation_id` kรถnnen Sie die OpenAPI `operationId` festlegen
Sie mรผssten sicherstellen, dass sie fรผr jede Operation eindeutig ist. Sie mรผssten sicherstellen, dass sie fรผr jede Operation eindeutig ist.
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial001.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial001.py!}
``` ```
### Verwendung des Namens der *Pfadoperation-Funktion* als operationId ### Verwendung des Namens der *Pfadoperation-Funktion* als operationId
@ -23,7 +23,7 @@ Wenn Sie die Funktionsnamen Ihrer API als `operationId`s verwenden mรถchten, kรถ
Sie sollten dies tun, nachdem Sie alle Ihre *Pfadoperationen* hinzugefรผgt haben. Sie sollten dies tun, nachdem Sie alle Ihre *Pfadoperationen* hinzugefรผgt haben.
```Python hl_lines="2 12-21 24" ```Python hl_lines="2 12-21 24"
{!../../../docs_src/path_operation_advanced_configuration/tutorial002.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial002.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -45,7 +45,7 @@ Auch wenn diese sich in unterschiedlichen Modulen (Python-Dateien) befinden.
Um eine *Pfadoperation* aus dem generierten OpenAPI-Schema (und damit aus den automatischen Dokumentationssystemen) auszuschlieรŸen, verwenden Sie den Parameter `include_in_schema` und setzen Sie ihn auf `False`: Um eine *Pfadoperation* aus dem generierten OpenAPI-Schema (und damit aus den automatischen Dokumentationssystemen) auszuschlieรŸen, verwenden Sie den Parameter `include_in_schema` und setzen Sie ihn auf `False`:
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial003.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial003.py!}
``` ```
## Fortgeschrittene Beschreibung mittels Docstring ## Fortgeschrittene Beschreibung mittels Docstring
@ -57,7 +57,7 @@ Das Hinzufรผgen eines `\f` (ein maskiertes โ€žForm Feedโ€œ-Zeichen) fรผhrt dazu,
Sie wird nicht in der Dokumentation angezeigt, aber andere Tools (z. B. Sphinx) kรถnnen den Rest verwenden. Sie wird nicht in der Dokumentation angezeigt, aber andere Tools (z. B. Sphinx) kรถnnen den Rest verwenden.
```Python hl_lines="19-29" ```Python hl_lines="19-29"
{!../../../docs_src/path_operation_advanced_configuration/tutorial004.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial004.py!}
``` ```
## Zusรคtzliche Responses ## Zusรคtzliche Responses
@ -101,7 +101,7 @@ Sie kรถnnen das OpenAPI-Schema fรผr eine *Pfadoperation* erweitern, indem Sie de
Dieses `openapi_extra` kann beispielsweise hilfreich sein, um <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specificationExtensions" class="external-link" target="_blank">OpenAPI-Erweiterungen</a> zu deklarieren: Dieses `openapi_extra` kann beispielsweise hilfreich sein, um <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specificationExtensions" class="external-link" target="_blank">OpenAPI-Erweiterungen</a> zu deklarieren:
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial005.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial005.py!}
``` ```
Wenn Sie die automatische API-Dokumentation รถffnen, wird Ihre Erweiterung am Ende der spezifischen *Pfadoperation* angezeigt. Wenn Sie die automatische API-Dokumentation รถffnen, wird Ihre Erweiterung am Ende der spezifischen *Pfadoperation* angezeigt.
@ -150,7 +150,7 @@ Sie kรถnnten sich beispielsweise dafรผr entscheiden, den Request mit Ihrem eigen
Das kรถnnte man mit `openapi_extra` machen: Das kรถnnte man mit `openapi_extra` machen:
```Python hl_lines="20-37 39-40" ```Python hl_lines="20-37 39-40"
{!../../../docs_src/path_operation_advanced_configuration/tutorial006.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial006.py!}
``` ```
In diesem Beispiel haben wir kein Pydantic-Modell deklariert. Tatsรคchlich wird der Requestbody nicht einmal als JSON <abbr title="von einem einfachen Format, wie Bytes, in Python-Objekte konvertieren">geparst</abbr>, sondern direkt als `bytes` gelesen und die Funktion `magic_data_reader ()` wรคre dafรผr verantwortlich, ihn in irgendeiner Weise zu parsen. In diesem Beispiel haben wir kein Pydantic-Modell deklariert. Tatsรคchlich wird der Requestbody nicht einmal als JSON <abbr title="von einem einfachen Format, wie Bytes, in Python-Objekte konvertieren">geparst</abbr>, sondern direkt als `bytes` gelesen und die Funktion `magic_data_reader ()` wรคre dafรผr verantwortlich, ihn in irgendeiner Weise zu parsen.
@ -168,7 +168,7 @@ In der folgenden Anwendung verwenden wir beispielsweise weder die integrierte Fu
//// tab | Pydantic v2 //// tab | Pydantic v2
```Python hl_lines="17-22 24" ```Python hl_lines="17-22 24"
{!> ../../../docs_src/path_operation_advanced_configuration/tutorial007.py!} {!> ../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
``` ```
//// ////
@ -176,7 +176,7 @@ In der folgenden Anwendung verwenden wir beispielsweise weder die integrierte Fu
//// tab | Pydantic v1 //// tab | Pydantic v1
```Python hl_lines="17-22 24" ```Python hl_lines="17-22 24"
{!> ../../../docs_src/path_operation_advanced_configuration/tutorial007_pv1.py!} {!> ../../docs_src/path_operation_advanced_configuration/tutorial007_pv1.py!}
``` ```
//// ////
@ -196,7 +196,7 @@ Und dann parsen wir in unserem Code diesen YAML-Inhalt direkt und verwenden dann
//// tab | Pydantic v2 //// tab | Pydantic v2
```Python hl_lines="26-33" ```Python hl_lines="26-33"
{!> ../../../docs_src/path_operation_advanced_configuration/tutorial007.py!} {!> ../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
``` ```
//// ////
@ -204,7 +204,7 @@ Und dann parsen wir in unserem Code diesen YAML-Inhalt direkt und verwenden dann
//// tab | Pydantic v1 //// tab | Pydantic v1
```Python hl_lines="26-33" ```Python hl_lines="26-33"
{!> ../../../docs_src/path_operation_advanced_configuration/tutorial007_pv1.py!} {!> ../../docs_src/path_operation_advanced_configuration/tutorial007_pv1.py!}
``` ```
//// ////

2
docs/de/docs/advanced/response-change-status-code.md

@ -21,7 +21,7 @@ Sie kรถnnen einen Parameter vom Typ `Response` in Ihrer *Pfadoperation-Funktion*
AnschlieรŸend kรถnnen Sie den `status_code` in diesem *vorรผbergehenden* Response-Objekt festlegen. AnschlieรŸend kรถnnen Sie den `status_code` in diesem *vorรผbergehenden* Response-Objekt festlegen.
```Python hl_lines="1 9 12" ```Python hl_lines="1 9 12"
{!../../../docs_src/response_change_status_code/tutorial001.py!} {!../../docs_src/response_change_status_code/tutorial001.py!}
``` ```
Und dann kรถnnen Sie wie gewohnt jedes benรถtigte Objekt zurรผckgeben (ein `dict`, ein Datenbankmodell usw.). Und dann kรถnnen Sie wie gewohnt jedes benรถtigte Objekt zurรผckgeben (ein `dict`, ein Datenbankmodell usw.).

4
docs/de/docs/advanced/response-cookies.md

@ -7,7 +7,7 @@ Sie kรถnnen einen Parameter vom Typ `Response` in Ihrer *Pfadoperation-Funktion*
Und dann kรถnnen Sie Cookies in diesem *vorรผbergehenden* Response-Objekt setzen. Und dann kรถnnen Sie Cookies in diesem *vorรผbergehenden* Response-Objekt setzen.
```Python hl_lines="1 8-9" ```Python hl_lines="1 8-9"
{!../../../docs_src/response_cookies/tutorial002.py!} {!../../docs_src/response_cookies/tutorial002.py!}
``` ```
AnschlieรŸend kรถnnen Sie wie gewohnt jedes gewรผnschte Objekt zurรผckgeben (ein `dict`, ein Datenbankmodell, usw.). AnschlieรŸend kรถnnen Sie wie gewohnt jedes gewรผnschte Objekt zurรผckgeben (ein `dict`, ein Datenbankmodell, usw.).
@ -27,7 +27,7 @@ Dazu kรถnnen Sie eine Response erstellen, wie unter [Eine Response direkt zurรผc
Setzen Sie dann Cookies darin und geben Sie sie dann zurรผck: Setzen Sie dann Cookies darin und geben Sie sie dann zurรผck:
```Python hl_lines="10-12" ```Python hl_lines="10-12"
{!../../../docs_src/response_cookies/tutorial001.py!} {!../../docs_src/response_cookies/tutorial001.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"

4
docs/de/docs/advanced/response-directly.md

@ -35,7 +35,7 @@ Sie kรถnnen beispielsweise kein Pydantic-Modell in eine `JSONResponse` einfรผgen
In diesen Fรคllen kรถnnen Sie den `jsonable_encoder` verwenden, um Ihre Daten zu konvertieren, bevor Sie sie an eine Response รผbergeben: In diesen Fรคllen kรถnnen Sie den `jsonable_encoder` verwenden, um Ihre Daten zu konvertieren, bevor Sie sie an eine Response รผbergeben:
```Python hl_lines="6-7 21-22" ```Python hl_lines="6-7 21-22"
{!../../../docs_src/response_directly/tutorial001.py!} {!../../docs_src/response_directly/tutorial001.py!}
``` ```
/// note | "Technische Details" /// note | "Technische Details"
@ -57,7 +57,7 @@ Nehmen wir an, Sie mรถchten eine <a href="https://en.wikipedia.org/wiki/XML" cla
Sie kรถnnten Ihren XML-Inhalt als String in eine `Response` einfรผgen und sie zurรผckgeben: Sie kรถnnten Ihren XML-Inhalt als String in eine `Response` einfรผgen und sie zurรผckgeben:
```Python hl_lines="1 18" ```Python hl_lines="1 18"
{!../../../docs_src/response_directly/tutorial002.py!} {!../../docs_src/response_directly/tutorial002.py!}
``` ```
## Anmerkungen ## Anmerkungen

4
docs/de/docs/advanced/response-headers.md

@ -7,7 +7,7 @@ Sie kรถnnen einen Parameter vom Typ `Response` in Ihrer *Pfadoperation-Funktion*
Und dann kรถnnen Sie Header in diesem *vorรผbergehenden* Response-Objekt festlegen. Und dann kรถnnen Sie Header in diesem *vorรผbergehenden* Response-Objekt festlegen.
```Python hl_lines="1 7-8" ```Python hl_lines="1 7-8"
{!../../../docs_src/response_headers/tutorial002.py!} {!../../docs_src/response_headers/tutorial002.py!}
``` ```
AnschlieรŸend kรถnnen Sie wie gewohnt jedes gewรผnschte Objekt zurรผckgeben (ein `dict`, ein Datenbankmodell, usw.). AnschlieรŸend kรถnnen Sie wie gewohnt jedes gewรผnschte Objekt zurรผckgeben (ein `dict`, ein Datenbankmodell, usw.).
@ -25,7 +25,7 @@ Sie kรถnnen auch Header hinzufรผgen, wenn Sie eine `Response` direkt zurรผckgebe
Erstellen Sie eine Response wie in [Eine Response direkt zurรผckgeben](response-directly.md){.internal-link target=_blank} beschrieben und รผbergeben Sie die Header als zusรคtzlichen Parameter: Erstellen Sie eine Response wie in [Eine Response direkt zurรผckgeben](response-directly.md){.internal-link target=_blank} beschrieben und รผbergeben Sie die Header als zusรคtzlichen Parameter:
```Python hl_lines="10-12" ```Python hl_lines="10-12"
{!../../../docs_src/response_headers/tutorial001.py!} {!../../docs_src/response_headers/tutorial001.py!}
``` ```
/// note | "Technische Details" /// note | "Technische Details"

18
docs/de/docs/advanced/security/http-basic-auth.md

@ -23,7 +23,7 @@ Wenn Sie dann den Benutzernamen und das Passwort eingeben, sendet der Browser di
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="4 8 12" ```Python hl_lines="4 8 12"
{!> ../../../docs_src/security/tutorial006_an_py39.py!} {!> ../../docs_src/security/tutorial006_an_py39.py!}
``` ```
//// ////
@ -31,7 +31,7 @@ Wenn Sie dann den Benutzernamen und das Passwort eingeben, sendet der Browser di
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="2 7 11" ```Python hl_lines="2 7 11"
{!> ../../../docs_src/security/tutorial006_an.py!} {!> ../../docs_src/security/tutorial006_an.py!}
``` ```
//// ////
@ -45,7 +45,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="2 6 10" ```Python hl_lines="2 6 10"
{!> ../../../docs_src/security/tutorial006.py!} {!> ../../docs_src/security/tutorial006.py!}
``` ```
//// ////
@ -71,7 +71,7 @@ Dann kรถnnen wir `secrets.compare_digest()` verwenden, um sicherzustellen, dass
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="1 12-24" ```Python hl_lines="1 12-24"
{!> ../../../docs_src/security/tutorial007_an_py39.py!} {!> ../../docs_src/security/tutorial007_an_py39.py!}
``` ```
//// ////
@ -79,7 +79,7 @@ Dann kรถnnen wir `secrets.compare_digest()` verwenden, um sicherzustellen, dass
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 12-24" ```Python hl_lines="1 12-24"
{!> ../../../docs_src/security/tutorial007_an.py!} {!> ../../docs_src/security/tutorial007_an.py!}
``` ```
//// ////
@ -93,7 +93,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1 11-21" ```Python hl_lines="1 11-21"
{!> ../../../docs_src/security/tutorial007.py!} {!> ../../docs_src/security/tutorial007.py!}
``` ```
//// ////
@ -163,7 +163,7 @@ Nachdem Sie festgestellt haben, dass die Anmeldeinformationen falsch sind, geben
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="26-30" ```Python hl_lines="26-30"
{!> ../../../docs_src/security/tutorial007_an_py39.py!} {!> ../../docs_src/security/tutorial007_an_py39.py!}
``` ```
//// ////
@ -171,7 +171,7 @@ Nachdem Sie festgestellt haben, dass die Anmeldeinformationen falsch sind, geben
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="26-30" ```Python hl_lines="26-30"
{!> ../../../docs_src/security/tutorial007_an.py!} {!> ../../docs_src/security/tutorial007_an.py!}
``` ```
//// ////
@ -185,7 +185,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="23-27" ```Python hl_lines="23-27"
{!> ../../../docs_src/security/tutorial007.py!} {!> ../../docs_src/security/tutorial007.py!}
``` ```
//// ////

96
docs/de/docs/advanced/security/oauth2-scopes.md

@ -65,7 +65,7 @@ Sehen wir uns zunรคchst kurz die Teile an, die sich gegenรผber den Beispielen im
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="4 8 12 46 64 105 107-115 121-124 128-134 139 155" ```Python hl_lines="4 8 12 46 64 105 107-115 121-124 128-134 139 155"
{!> ../../../docs_src/security/tutorial005_an_py310.py!} {!> ../../docs_src/security/tutorial005_an_py310.py!}
``` ```
//// ////
@ -73,7 +73,7 @@ Sehen wir uns zunรคchst kurz die Teile an, die sich gegenรผber den Beispielen im
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155" ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
{!> ../../../docs_src/security/tutorial005_an_py39.py!} {!> ../../docs_src/security/tutorial005_an_py39.py!}
``` ```
//// ////
@ -81,7 +81,7 @@ Sehen wir uns zunรคchst kurz die Teile an, die sich gegenรผber den Beispielen im
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="2 4 8 12 47 65 106 108-116 122-125 129-135 140 156" ```Python hl_lines="2 4 8 12 47 65 106 108-116 122-125 129-135 140 156"
{!> ../../../docs_src/security/tutorial005_an.py!} {!> ../../docs_src/security/tutorial005_an.py!}
``` ```
//// ////
@ -95,7 +95,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="3 7 11 45 63 104 106-114 120-123 127-133 138 154" ```Python hl_lines="3 7 11 45 63 104 106-114 120-123 127-133 138 154"
{!> ../../../docs_src/security/tutorial005_py310.py!} {!> ../../docs_src/security/tutorial005_py310.py!}
``` ```
//// ////
@ -109,7 +109,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155" ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
{!> ../../../docs_src/security/tutorial005_py39.py!} {!> ../../docs_src/security/tutorial005_py39.py!}
``` ```
//// ////
@ -123,7 +123,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155" ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
{!> ../../../docs_src/security/tutorial005.py!} {!> ../../docs_src/security/tutorial005.py!}
``` ```
//// ////
@ -139,7 +139,7 @@ Der `scopes`-Parameter erhรคlt ein `dict` mit jedem Scope als Schlรผssel und des
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="62-65" ```Python hl_lines="62-65"
{!> ../../../docs_src/security/tutorial005_an_py310.py!} {!> ../../docs_src/security/tutorial005_an_py310.py!}
``` ```
//// ////
@ -147,7 +147,7 @@ Der `scopes`-Parameter erhรคlt ein `dict` mit jedem Scope als Schlรผssel und des
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="62-65" ```Python hl_lines="62-65"
{!> ../../../docs_src/security/tutorial005_an_py39.py!} {!> ../../docs_src/security/tutorial005_an_py39.py!}
``` ```
//// ////
@ -155,7 +155,7 @@ Der `scopes`-Parameter erhรคlt ein `dict` mit jedem Scope als Schlรผssel und des
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="63-66" ```Python hl_lines="63-66"
{!> ../../../docs_src/security/tutorial005_an.py!} {!> ../../docs_src/security/tutorial005_an.py!}
``` ```
//// ////
@ -169,7 +169,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="61-64" ```Python hl_lines="61-64"
{!> ../../../docs_src/security/tutorial005_py310.py!} {!> ../../docs_src/security/tutorial005_py310.py!}
``` ```
//// ////
@ -183,7 +183,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="62-65" ```Python hl_lines="62-65"
{!> ../../../docs_src/security/tutorial005_py39.py!} {!> ../../docs_src/security/tutorial005_py39.py!}
``` ```
//// ////
@ -197,7 +197,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="62-65" ```Python hl_lines="62-65"
{!> ../../../docs_src/security/tutorial005.py!} {!> ../../docs_src/security/tutorial005.py!}
``` ```
//// ////
@ -229,7 +229,7 @@ Aus Sicherheitsgrรผnden sollten Sie jedoch sicherstellen, dass Sie in Ihrer Anwe
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="155" ```Python hl_lines="155"
{!> ../../../docs_src/security/tutorial005_an_py310.py!} {!> ../../docs_src/security/tutorial005_an_py310.py!}
``` ```
//// ////
@ -237,7 +237,7 @@ Aus Sicherheitsgrรผnden sollten Sie jedoch sicherstellen, dass Sie in Ihrer Anwe
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="155" ```Python hl_lines="155"
{!> ../../../docs_src/security/tutorial005_an_py39.py!} {!> ../../docs_src/security/tutorial005_an_py39.py!}
``` ```
//// ////
@ -245,7 +245,7 @@ Aus Sicherheitsgrรผnden sollten Sie jedoch sicherstellen, dass Sie in Ihrer Anwe
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="156" ```Python hl_lines="156"
{!> ../../../docs_src/security/tutorial005_an.py!} {!> ../../docs_src/security/tutorial005_an.py!}
``` ```
//// ////
@ -259,7 +259,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="154" ```Python hl_lines="154"
{!> ../../../docs_src/security/tutorial005_py310.py!} {!> ../../docs_src/security/tutorial005_py310.py!}
``` ```
//// ////
@ -273,7 +273,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="155" ```Python hl_lines="155"
{!> ../../../docs_src/security/tutorial005_py39.py!} {!> ../../docs_src/security/tutorial005_py39.py!}
``` ```
//// ////
@ -287,7 +287,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="155" ```Python hl_lines="155"
{!> ../../../docs_src/security/tutorial005.py!} {!> ../../docs_src/security/tutorial005.py!}
``` ```
//// ////
@ -319,7 +319,7 @@ Wir tun dies hier, um zu demonstrieren, wie **FastAPI** auf verschiedenen Ebenen
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="4 139 170" ```Python hl_lines="4 139 170"
{!> ../../../docs_src/security/tutorial005_an_py310.py!} {!> ../../docs_src/security/tutorial005_an_py310.py!}
``` ```
//// ////
@ -327,7 +327,7 @@ Wir tun dies hier, um zu demonstrieren, wie **FastAPI** auf verschiedenen Ebenen
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="4 139 170" ```Python hl_lines="4 139 170"
{!> ../../../docs_src/security/tutorial005_an_py39.py!} {!> ../../docs_src/security/tutorial005_an_py39.py!}
``` ```
//// ////
@ -335,7 +335,7 @@ Wir tun dies hier, um zu demonstrieren, wie **FastAPI** auf verschiedenen Ebenen
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="4 140 171" ```Python hl_lines="4 140 171"
{!> ../../../docs_src/security/tutorial005_an.py!} {!> ../../docs_src/security/tutorial005_an.py!}
``` ```
//// ////
@ -349,7 +349,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="3 138 167" ```Python hl_lines="3 138 167"
{!> ../../../docs_src/security/tutorial005_py310.py!} {!> ../../docs_src/security/tutorial005_py310.py!}
``` ```
//// ////
@ -363,7 +363,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="4 139 168" ```Python hl_lines="4 139 168"
{!> ../../../docs_src/security/tutorial005_py39.py!} {!> ../../docs_src/security/tutorial005_py39.py!}
``` ```
//// ////
@ -377,7 +377,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="4 139 168" ```Python hl_lines="4 139 168"
{!> ../../../docs_src/security/tutorial005.py!} {!> ../../docs_src/security/tutorial005.py!}
``` ```
//// ////
@ -409,7 +409,7 @@ Diese `SecurityScopes`-Klasse รคhnelt `Request` (`Request` wurde verwendet, um d
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="8 105" ```Python hl_lines="8 105"
{!> ../../../docs_src/security/tutorial005_an_py310.py!} {!> ../../docs_src/security/tutorial005_an_py310.py!}
``` ```
//// ////
@ -417,7 +417,7 @@ Diese `SecurityScopes`-Klasse รคhnelt `Request` (`Request` wurde verwendet, um d
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="8 105" ```Python hl_lines="8 105"
{!> ../../../docs_src/security/tutorial005_an_py39.py!} {!> ../../docs_src/security/tutorial005_an_py39.py!}
``` ```
//// ////
@ -425,7 +425,7 @@ Diese `SecurityScopes`-Klasse รคhnelt `Request` (`Request` wurde verwendet, um d
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8 106" ```Python hl_lines="8 106"
{!> ../../../docs_src/security/tutorial005_an.py!} {!> ../../docs_src/security/tutorial005_an.py!}
``` ```
//// ////
@ -439,7 +439,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7 104" ```Python hl_lines="7 104"
{!> ../../../docs_src/security/tutorial005_py310.py!} {!> ../../docs_src/security/tutorial005_py310.py!}
``` ```
//// ////
@ -453,7 +453,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8 105" ```Python hl_lines="8 105"
{!> ../../../docs_src/security/tutorial005_py39.py!} {!> ../../docs_src/security/tutorial005_py39.py!}
``` ```
//// ////
@ -467,7 +467,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8 105" ```Python hl_lines="8 105"
{!> ../../../docs_src/security/tutorial005.py!} {!> ../../docs_src/security/tutorial005.py!}
``` ```
//// ////
@ -487,7 +487,7 @@ In diese Exception fรผgen wir (falls vorhanden) die erforderlichen Scopes als du
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="105 107-115" ```Python hl_lines="105 107-115"
{!> ../../../docs_src/security/tutorial005_an_py310.py!} {!> ../../docs_src/security/tutorial005_an_py310.py!}
``` ```
//// ////
@ -495,7 +495,7 @@ In diese Exception fรผgen wir (falls vorhanden) die erforderlichen Scopes als du
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="105 107-115" ```Python hl_lines="105 107-115"
{!> ../../../docs_src/security/tutorial005_an_py39.py!} {!> ../../docs_src/security/tutorial005_an_py39.py!}
``` ```
//// ////
@ -503,7 +503,7 @@ In diese Exception fรผgen wir (falls vorhanden) die erforderlichen Scopes als du
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="106 108-116" ```Python hl_lines="106 108-116"
{!> ../../../docs_src/security/tutorial005_an.py!} {!> ../../docs_src/security/tutorial005_an.py!}
``` ```
//// ////
@ -517,7 +517,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="104 106-114" ```Python hl_lines="104 106-114"
{!> ../../../docs_src/security/tutorial005_py310.py!} {!> ../../docs_src/security/tutorial005_py310.py!}
``` ```
//// ////
@ -531,7 +531,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="105 107-115" ```Python hl_lines="105 107-115"
{!> ../../../docs_src/security/tutorial005_py39.py!} {!> ../../docs_src/security/tutorial005_py39.py!}
``` ```
//// ////
@ -545,7 +545,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="105 107-115" ```Python hl_lines="105 107-115"
{!> ../../../docs_src/security/tutorial005.py!} {!> ../../docs_src/security/tutorial005.py!}
``` ```
//// ////
@ -567,7 +567,7 @@ Wir verifizieren auch, dass wir einen Benutzer mit diesem Benutzernamen haben, u
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="46 116-127" ```Python hl_lines="46 116-127"
{!> ../../../docs_src/security/tutorial005_an_py310.py!} {!> ../../docs_src/security/tutorial005_an_py310.py!}
``` ```
//// ////
@ -575,7 +575,7 @@ Wir verifizieren auch, dass wir einen Benutzer mit diesem Benutzernamen haben, u
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="46 116-127" ```Python hl_lines="46 116-127"
{!> ../../../docs_src/security/tutorial005_an_py39.py!} {!> ../../docs_src/security/tutorial005_an_py39.py!}
``` ```
//// ////
@ -583,7 +583,7 @@ Wir verifizieren auch, dass wir einen Benutzer mit diesem Benutzernamen haben, u
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="47 117-128" ```Python hl_lines="47 117-128"
{!> ../../../docs_src/security/tutorial005_an.py!} {!> ../../docs_src/security/tutorial005_an.py!}
``` ```
//// ////
@ -597,7 +597,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="45 115-126" ```Python hl_lines="45 115-126"
{!> ../../../docs_src/security/tutorial005_py310.py!} {!> ../../docs_src/security/tutorial005_py310.py!}
``` ```
//// ////
@ -611,7 +611,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="46 116-127" ```Python hl_lines="46 116-127"
{!> ../../../docs_src/security/tutorial005_py39.py!} {!> ../../docs_src/security/tutorial005_py39.py!}
``` ```
//// ////
@ -625,7 +625,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="46 116-127" ```Python hl_lines="46 116-127"
{!> ../../../docs_src/security/tutorial005.py!} {!> ../../docs_src/security/tutorial005.py!}
``` ```
//// ////
@ -639,7 +639,7 @@ Hierzu verwenden wir `security_scopes.scopes`, das eine `list`e mit allen diesen
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="128-134" ```Python hl_lines="128-134"
{!> ../../../docs_src/security/tutorial005_an_py310.py!} {!> ../../docs_src/security/tutorial005_an_py310.py!}
``` ```
//// ////
@ -647,7 +647,7 @@ Hierzu verwenden wir `security_scopes.scopes`, das eine `list`e mit allen diesen
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="128-134" ```Python hl_lines="128-134"
{!> ../../../docs_src/security/tutorial005_an_py39.py!} {!> ../../docs_src/security/tutorial005_an_py39.py!}
``` ```
//// ////
@ -655,7 +655,7 @@ Hierzu verwenden wir `security_scopes.scopes`, das eine `list`e mit allen diesen
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="129-135" ```Python hl_lines="129-135"
{!> ../../../docs_src/security/tutorial005_an.py!} {!> ../../docs_src/security/tutorial005_an.py!}
``` ```
//// ////
@ -669,7 +669,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="127-133" ```Python hl_lines="127-133"
{!> ../../../docs_src/security/tutorial005_py310.py!} {!> ../../docs_src/security/tutorial005_py310.py!}
``` ```
//// ////
@ -683,7 +683,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="128-134" ```Python hl_lines="128-134"
{!> ../../../docs_src/security/tutorial005_py39.py!} {!> ../../docs_src/security/tutorial005_py39.py!}
``` ```
//// ////
@ -697,7 +697,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="128-134" ```Python hl_lines="128-134"
{!> ../../../docs_src/security/tutorial005.py!} {!> ../../docs_src/security/tutorial005.py!}
``` ```
//// ////

36
docs/de/docs/advanced/settings.md

@ -181,7 +181,7 @@ Sie kรถnnen dieselben Validierungs-Funktionen und -Tools verwenden, die Sie fรผr
//// tab | Pydantic v2 //// tab | Pydantic v2
```Python hl_lines="2 5-8 11" ```Python hl_lines="2 5-8 11"
{!> ../../../docs_src/settings/tutorial001.py!} {!> ../../docs_src/settings/tutorial001.py!}
``` ```
//// ////
@ -195,7 +195,7 @@ In Pydantic v1 wรผrden Sie `BaseSettings` direkt von `pydantic` statt von `pydan
/// ///
```Python hl_lines="2 5-8 11" ```Python hl_lines="2 5-8 11"
{!> ../../../docs_src/settings/tutorial001_pv1.py!} {!> ../../docs_src/settings/tutorial001_pv1.py!}
``` ```
//// ////
@ -215,7 +215,7 @@ Als Nรคchstes werden die Daten konvertiert und validiert. Wenn Sie also dieses `
Dann kรถnnen Sie das neue `settings`-Objekt in Ihrer Anwendung verwenden: Dann kรถnnen Sie das neue `settings`-Objekt in Ihrer Anwendung verwenden:
```Python hl_lines="18-20" ```Python hl_lines="18-20"
{!../../../docs_src/settings/tutorial001.py!} {!../../docs_src/settings/tutorial001.py!}
``` ```
### Den Server ausfรผhren ### Den Server ausfรผhren
@ -251,13 +251,13 @@ Sie kรถnnten diese Einstellungen in eine andere Moduldatei einfรผgen, wie Sie in
Sie kรถnnten beispielsweise eine Datei `config.py` haben mit: Sie kรถnnten beispielsweise eine Datei `config.py` haben mit:
```Python ```Python
{!../../../docs_src/settings/app01/config.py!} {!../../docs_src/settings/app01/config.py!}
``` ```
Und dann verwenden Sie diese in einer Datei `main.py`: Und dann verwenden Sie diese in einer Datei `main.py`:
```Python hl_lines="3 11-13" ```Python hl_lines="3 11-13"
{!../../../docs_src/settings/app01/main.py!} {!../../docs_src/settings/app01/main.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -277,7 +277,7 @@ Dies kรถnnte besonders beim Testen nรผtzlich sein, da es sehr einfach ist, eine
Ausgehend vom vorherigen Beispiel kรถnnte Ihre Datei `config.py` so aussehen: Ausgehend vom vorherigen Beispiel kรถnnte Ihre Datei `config.py` so aussehen:
```Python hl_lines="10" ```Python hl_lines="10"
{!../../../docs_src/settings/app02/config.py!} {!../../docs_src/settings/app02/config.py!}
``` ```
Beachten Sie, dass wir jetzt keine Standardinstanz `settings = Settings()` erstellen. Beachten Sie, dass wir jetzt keine Standardinstanz `settings = Settings()` erstellen.
@ -289,7 +289,7 @@ Jetzt erstellen wir eine Abhรคngigkeit, die ein neues `config.Settings()` zurรผc
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="6 12-13" ```Python hl_lines="6 12-13"
{!> ../../../docs_src/settings/app02_an_py39/main.py!} {!> ../../docs_src/settings/app02_an_py39/main.py!}
``` ```
//// ////
@ -297,7 +297,7 @@ Jetzt erstellen wir eine Abhรคngigkeit, die ein neues `config.Settings()` zurรผc
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="6 12-13" ```Python hl_lines="6 12-13"
{!> ../../../docs_src/settings/app02_an/main.py!} {!> ../../docs_src/settings/app02_an/main.py!}
``` ```
//// ////
@ -311,7 +311,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="5 11-12" ```Python hl_lines="5 11-12"
{!> ../../../docs_src/settings/app02/main.py!} {!> ../../docs_src/settings/app02/main.py!}
``` ```
//// ////
@ -329,7 +329,7 @@ Und dann kรถnnen wir das von der *Pfadoperation-Funktion* als Abhรคngigkeit einf
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="17 19-21" ```Python hl_lines="17 19-21"
{!> ../../../docs_src/settings/app02_an_py39/main.py!} {!> ../../docs_src/settings/app02_an_py39/main.py!}
``` ```
//// ////
@ -337,7 +337,7 @@ Und dann kรถnnen wir das von der *Pfadoperation-Funktion* als Abhรคngigkeit einf
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="17 19-21" ```Python hl_lines="17 19-21"
{!> ../../../docs_src/settings/app02_an/main.py!} {!> ../../docs_src/settings/app02_an/main.py!}
``` ```
//// ////
@ -351,7 +351,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="16 18-20" ```Python hl_lines="16 18-20"
{!> ../../../docs_src/settings/app02/main.py!} {!> ../../docs_src/settings/app02/main.py!}
``` ```
//// ////
@ -361,7 +361,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
Dann wรคre es sehr einfach, beim Testen ein anderes Einstellungsobjekt bereitzustellen, indem man eine Abhรคngigkeitsรผberschreibung fรผr `get_settings` erstellt: Dann wรคre es sehr einfach, beim Testen ein anderes Einstellungsobjekt bereitzustellen, indem man eine Abhรคngigkeitsรผberschreibung fรผr `get_settings` erstellt:
```Python hl_lines="9-10 13 21" ```Python hl_lines="9-10 13 21"
{!../../../docs_src/settings/app02/test_main.py!} {!../../docs_src/settings/app02/test_main.py!}
``` ```
Bei der Abhรคngigkeitsรผberschreibung legen wir einen neuen Wert fรผr `admin_email` fest, wenn wir das neue `Settings`-Objekt erstellen, und geben dann dieses neue Objekt zurรผck. Bei der Abhรคngigkeitsรผberschreibung legen wir einen neuen Wert fรผr `admin_email` fest, wenn wir das neue `Settings`-Objekt erstellen, und geben dann dieses neue Objekt zurรผck.
@ -406,7 +406,7 @@ Und dann aktualisieren Sie Ihre `config.py` mit:
//// tab | Pydantic v2 //// tab | Pydantic v2
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/settings/app03_an/config.py!} {!> ../../docs_src/settings/app03_an/config.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -420,7 +420,7 @@ Das Attribut `model_config` wird nur fรผr die Pydantic-Konfiguration verwendet.
//// tab | Pydantic v1 //// tab | Pydantic v1
```Python hl_lines="9-10" ```Python hl_lines="9-10"
{!> ../../../docs_src/settings/app03_an/config_pv1.py!} {!> ../../docs_src/settings/app03_an/config_pv1.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -465,7 +465,7 @@ Da wir jedoch den `@lru_cache`-Dekorator oben verwenden, wird das `Settings`-Obj
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="1 11" ```Python hl_lines="1 11"
{!> ../../../docs_src/settings/app03_an_py39/main.py!} {!> ../../docs_src/settings/app03_an_py39/main.py!}
``` ```
//// ////
@ -473,7 +473,7 @@ Da wir jedoch den `@lru_cache`-Dekorator oben verwenden, wird das `Settings`-Obj
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 11" ```Python hl_lines="1 11"
{!> ../../../docs_src/settings/app03_an/main.py!} {!> ../../docs_src/settings/app03_an/main.py!}
``` ```
//// ////
@ -487,7 +487,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1 10" ```Python hl_lines="1 10"
{!> ../../../docs_src/settings/app03/main.py!} {!> ../../docs_src/settings/app03/main.py!}
``` ```
//// ////

6
docs/de/docs/advanced/sub-applications.md

@ -11,7 +11,7 @@ Wenn Sie zwei unabhรคngige FastAPI-Anwendungen mit deren eigenen unabhรคngigen O
Erstellen Sie zunรคchst die Hauptanwendung **FastAPI** und deren *Pfadoperationen*: Erstellen Sie zunรคchst die Hauptanwendung **FastAPI** und deren *Pfadoperationen*:
```Python hl_lines="3 6-8" ```Python hl_lines="3 6-8"
{!../../../docs_src/sub_applications/tutorial001.py!} {!../../docs_src/sub_applications/tutorial001.py!}
``` ```
### Unteranwendung ### Unteranwendung
@ -21,7 +21,7 @@ Erstellen Sie dann Ihre Unteranwendung und deren *Pfadoperationen*.
Diese Unteranwendung ist nur eine weitere Standard-FastAPI-Anwendung, aber diese wird โ€žgemountetโ€œ: Diese Unteranwendung ist nur eine weitere Standard-FastAPI-Anwendung, aber diese wird โ€žgemountetโ€œ:
```Python hl_lines="11 14-16" ```Python hl_lines="11 14-16"
{!../../../docs_src/sub_applications/tutorial001.py!} {!../../docs_src/sub_applications/tutorial001.py!}
``` ```
### Die Unteranwendung mounten ### Die Unteranwendung mounten
@ -31,7 +31,7 @@ Mounten Sie in Ihrer Top-Level-Anwendung `app` die Unteranwendung `subapi`.
In diesem Fall wird sie im Pfad `/subapi` gemountet: In diesem Fall wird sie im Pfad `/subapi` gemountet:
```Python hl_lines="11 19" ```Python hl_lines="11 19"
{!../../../docs_src/sub_applications/tutorial001.py!} {!../../docs_src/sub_applications/tutorial001.py!}
``` ```
### Es in der automatischen API-Dokumentation betrachten ### Es in der automatischen API-Dokumentation betrachten

8
docs/de/docs/advanced/templates.md

@ -28,7 +28,7 @@ $ pip install jinja2
* Verwenden Sie die von Ihnen erstellten `templates`, um eine `TemplateResponse` zu rendern und zurรผckzugeben, รผbergeben Sie den Namen des Templates, das Requestobjekt und ein โ€žKontextโ€œ-Dictionary mit Schlรผssel-Wert-Paaren, die innerhalb des Jinja2-Templates verwendet werden sollen. * Verwenden Sie die von Ihnen erstellten `templates`, um eine `TemplateResponse` zu rendern und zurรผckzugeben, รผbergeben Sie den Namen des Templates, das Requestobjekt und ein โ€žKontextโ€œ-Dictionary mit Schlรผssel-Wert-Paaren, die innerhalb des Jinja2-Templates verwendet werden sollen.
```Python hl_lines="4 11 15-18" ```Python hl_lines="4 11 15-18"
{!../../../docs_src/templates/tutorial001.py!} {!../../docs_src/templates/tutorial001.py!}
``` ```
/// note | "Hinweis" /// note | "Hinweis"
@ -58,7 +58,7 @@ Sie kรถnnen auch `from starlette.templating import Jinja2Templates` verwenden.
Dann kรถnnen Sie unter `templates/item.html` ein Template erstellen, mit z. B. folgendem Inhalt: Dann kรถnnen Sie unter `templates/item.html` ein Template erstellen, mit z. B. folgendem Inhalt:
```jinja hl_lines="7" ```jinja hl_lines="7"
{!../../../docs_src/templates/templates/item.html!} {!../../docs_src/templates/templates/item.html!}
``` ```
### Template-Kontextwerte ### Template-Kontextwerte
@ -112,13 +112,13 @@ Mit beispielsweise der ID `42` wรผrde dies Folgendes ergeben:
Sie kรถnnen `url_for()` innerhalb des Templates auch beispielsweise mit den `StaticFiles` verwenden, die Sie mit `name="static"` gemountet haben. Sie kรถnnen `url_for()` innerhalb des Templates auch beispielsweise mit den `StaticFiles` verwenden, die Sie mit `name="static"` gemountet haben.
```jinja hl_lines="4" ```jinja hl_lines="4"
{!../../../docs_src/templates/templates/item.html!} {!../../docs_src/templates/templates/item.html!}
``` ```
In diesem Beispiel wรผrde das zu einer CSS-Datei unter `static/styles.css` verlinken, mit folgendem Inhalt: In diesem Beispiel wรผrde das zu einer CSS-Datei unter `static/styles.css` verlinken, mit folgendem Inhalt:
```CSS hl_lines="4" ```CSS hl_lines="4"
{!../../../docs_src/templates/static/styles.css!} {!../../docs_src/templates/static/styles.css!}
``` ```
Und da Sie `StaticFiles` verwenden, wird diese CSS-Datei automatisch von Ihrer **FastAPI**-Anwendung unter der URL `/static/styles.css` bereitgestellt. Und da Sie `StaticFiles` verwenden, wird diese CSS-Datei automatisch von Ihrer **FastAPI**-Anwendung unter der URL `/static/styles.css` bereitgestellt.

10
docs/de/docs/advanced/testing-dependencies.md

@ -31,7 +31,7 @@ Und dann ruft **FastAPI** diese รœberschreibung anstelle der ursprรผnglichen Abh
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="26-27 30" ```Python hl_lines="26-27 30"
{!> ../../../docs_src/dependency_testing/tutorial001_an_py310.py!} {!> ../../docs_src/dependency_testing/tutorial001_an_py310.py!}
``` ```
//// ////
@ -39,7 +39,7 @@ Und dann ruft **FastAPI** diese รœberschreibung anstelle der ursprรผnglichen Abh
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="28-29 32" ```Python hl_lines="28-29 32"
{!> ../../../docs_src/dependency_testing/tutorial001_an_py39.py!} {!> ../../docs_src/dependency_testing/tutorial001_an_py39.py!}
``` ```
//// ////
@ -47,7 +47,7 @@ Und dann ruft **FastAPI** diese รœberschreibung anstelle der ursprรผnglichen Abh
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="29-30 33" ```Python hl_lines="29-30 33"
{!> ../../../docs_src/dependency_testing/tutorial001_an.py!} {!> ../../docs_src/dependency_testing/tutorial001_an.py!}
``` ```
//// ////
@ -61,7 +61,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="24-25 28" ```Python hl_lines="24-25 28"
{!> ../../../docs_src/dependency_testing/tutorial001_py310.py!} {!> ../../docs_src/dependency_testing/tutorial001_py310.py!}
``` ```
//// ////
@ -75,7 +75,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="28-29 32" ```Python hl_lines="28-29 32"
{!> ../../../docs_src/dependency_testing/tutorial001.py!} {!> ../../docs_src/dependency_testing/tutorial001.py!}
``` ```
//// ////

2
docs/de/docs/advanced/testing-events.md

@ -3,5 +3,5 @@
Wenn Sie in Ihren Tests Ihre Event-Handler (`startup` und `shutdown`) ausfรผhren wollen, kรถnnen Sie den `TestClient` mit einer `with`-Anweisung verwenden: Wenn Sie in Ihren Tests Ihre Event-Handler (`startup` und `shutdown`) ausfรผhren wollen, kรถnnen Sie den `TestClient` mit einer `with`-Anweisung verwenden:
```Python hl_lines="9-12 20-24" ```Python hl_lines="9-12 20-24"
{!../../../docs_src/app_testing/tutorial003.py!} {!../../docs_src/app_testing/tutorial003.py!}
``` ```

2
docs/de/docs/advanced/testing-websockets.md

@ -5,7 +5,7 @@ Sie kรถnnen den schon bekannten `TestClient` zum Testen von WebSockets verwenden
Dazu verwenden Sie den `TestClient` in einer `with`-Anweisung, eine Verbindung zum WebSocket herstellend: Dazu verwenden Sie den `TestClient` in einer `with`-Anweisung, eine Verbindung zum WebSocket herstellend:
```Python hl_lines="27-31" ```Python hl_lines="27-31"
{!../../../docs_src/app_testing/tutorial002.py!} {!../../docs_src/app_testing/tutorial002.py!}
``` ```
/// note | "Hinweis" /// note | "Hinweis"

2
docs/de/docs/advanced/using-request-directly.md

@ -30,7 +30,7 @@ Angenommen, Sie mรถchten auf die IP-Adresse/den Host des Clients in Ihrer *Pfado
Dazu mรผssen Sie direkt auf den Request zugreifen. Dazu mรผssen Sie direkt auf den Request zugreifen.
```Python hl_lines="1 7-8" ```Python hl_lines="1 7-8"
{!../../../docs_src/using_request_directly/tutorial001.py!} {!../../docs_src/using_request_directly/tutorial001.py!}
``` ```
Durch die Deklaration eines *Pfadoperation-Funktionsparameters*, dessen Typ der `Request` ist, weiรŸ **FastAPI**, dass es den `Request` diesem Parameter รผbergeben soll. Durch die Deklaration eines *Pfadoperation-Funktionsparameters*, dessen Typ der `Request` ist, weiรŸ **FastAPI**, dass es den `Request` diesem Parameter รผbergeben soll.

20
docs/de/docs/advanced/websockets.md

@ -39,7 +39,7 @@ In der Produktion hรคtten Sie eine der oben genannten Optionen.
Aber es ist die einfachste Mรถglichkeit, sich auf die Serverseite von WebSockets zu konzentrieren und ein funktionierendes Beispiel zu haben: Aber es ist die einfachste Mรถglichkeit, sich auf die Serverseite von WebSockets zu konzentrieren und ein funktionierendes Beispiel zu haben:
```Python hl_lines="2 6-38 41-43" ```Python hl_lines="2 6-38 41-43"
{!../../../docs_src/websockets/tutorial001.py!} {!../../docs_src/websockets/tutorial001.py!}
``` ```
## Einen `websocket` erstellen ## Einen `websocket` erstellen
@ -47,7 +47,7 @@ Aber es ist die einfachste Mรถglichkeit, sich auf die Serverseite von WebSockets
Erstellen Sie in Ihrer **FastAPI**-Anwendung einen `websocket`: Erstellen Sie in Ihrer **FastAPI**-Anwendung einen `websocket`:
```Python hl_lines="1 46-47" ```Python hl_lines="1 46-47"
{!../../../docs_src/websockets/tutorial001.py!} {!../../docs_src/websockets/tutorial001.py!}
``` ```
/// note | "Technische Details" /// note | "Technische Details"
@ -63,7 +63,7 @@ Sie kรถnnen auch `from starlette.websockets import WebSocket` verwenden.
In Ihrer WebSocket-Route kรถnnen Sie Nachrichten `await`en und Nachrichten senden. In Ihrer WebSocket-Route kรถnnen Sie Nachrichten `await`en und Nachrichten senden.
```Python hl_lines="48-52" ```Python hl_lines="48-52"
{!../../../docs_src/websockets/tutorial001.py!} {!../../docs_src/websockets/tutorial001.py!}
``` ```
Sie kรถnnen Binรคr-, Text- und JSON-Daten empfangen und senden. Sie kรถnnen Binรคr-, Text- und JSON-Daten empfangen und senden.
@ -118,7 +118,7 @@ Diese funktionieren auf die gleiche Weise wie fรผr andere FastAPI-Endpunkte/*Pfa
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="68-69 82" ```Python hl_lines="68-69 82"
{!> ../../../docs_src/websockets/tutorial002_an_py310.py!} {!> ../../docs_src/websockets/tutorial002_an_py310.py!}
``` ```
//// ////
@ -126,7 +126,7 @@ Diese funktionieren auf die gleiche Weise wie fรผr andere FastAPI-Endpunkte/*Pfa
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="68-69 82" ```Python hl_lines="68-69 82"
{!> ../../../docs_src/websockets/tutorial002_an_py39.py!} {!> ../../docs_src/websockets/tutorial002_an_py39.py!}
``` ```
//// ////
@ -134,7 +134,7 @@ Diese funktionieren auf die gleiche Weise wie fรผr andere FastAPI-Endpunkte/*Pfa
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="69-70 83" ```Python hl_lines="69-70 83"
{!> ../../../docs_src/websockets/tutorial002_an.py!} {!> ../../docs_src/websockets/tutorial002_an.py!}
``` ```
//// ////
@ -148,7 +148,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="66-67 79" ```Python hl_lines="66-67 79"
{!> ../../../docs_src/websockets/tutorial002_py310.py!} {!> ../../docs_src/websockets/tutorial002_py310.py!}
``` ```
//// ////
@ -162,7 +162,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="68-69 81" ```Python hl_lines="68-69 81"
{!> ../../../docs_src/websockets/tutorial002.py!} {!> ../../docs_src/websockets/tutorial002.py!}
``` ```
//// ////
@ -213,7 +213,7 @@ Wenn eine WebSocket-Verbindung geschlossen wird, lรถst `await websocket.receive_
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="79-81" ```Python hl_lines="79-81"
{!> ../../../docs_src/websockets/tutorial003_py39.py!} {!> ../../docs_src/websockets/tutorial003_py39.py!}
``` ```
//// ////
@ -221,7 +221,7 @@ Wenn eine WebSocket-Verbindung geschlossen wird, lรถst `await websocket.receive_
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="81-83" ```Python hl_lines="81-83"
{!> ../../../docs_src/websockets/tutorial003.py!} {!> ../../docs_src/websockets/tutorial003.py!}
``` ```
//// ////

2
docs/de/docs/advanced/wsgi.md

@ -13,7 +13,7 @@ Wrappen Sie dann die WSGI-Anwendung (z. B. Flask) mit der Middleware.
Und dann mounten Sie das auf einem Pfad. Und dann mounten Sie das auf einem Pfad.
```Python hl_lines="2-3 23" ```Python hl_lines="2-3 23"
{!../../../docs_src/wsgi/tutorial001.py!} {!../../docs_src/wsgi/tutorial001.py!}
``` ```
## Es ansehen ## Es ansehen

2
docs/de/docs/how-to/conditional-openapi.md

@ -30,7 +30,7 @@ Sie kรถnnen problemlos dieselben Pydantic-Einstellungen verwenden, um Ihre gener
Zum Beispiel: Zum Beispiel:
```Python hl_lines="6 11" ```Python hl_lines="6 11"
{!../../../docs_src/conditional_openapi/tutorial001.py!} {!../../docs_src/conditional_openapi/tutorial001.py!}
``` ```
Hier deklarieren wir die Einstellung `openapi_url` mit dem gleichen Defaultwert `"/openapi.json"`. Hier deklarieren wir die Einstellung `openapi_url` mit dem gleichen Defaultwert `"/openapi.json"`.

8
docs/de/docs/how-to/configure-swagger-ui.md

@ -19,7 +19,7 @@ Ohne ร„nderung der Einstellungen ist die Syntaxhervorhebung standardmรครŸig akti
Sie kรถnnen sie jedoch deaktivieren, indem Sie `syntaxHighlight` auf `False` setzen: Sie kรถnnen sie jedoch deaktivieren, indem Sie `syntaxHighlight` auf `False` setzen:
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/configure_swagger_ui/tutorial001.py!} {!../../docs_src/configure_swagger_ui/tutorial001.py!}
``` ```
... und dann zeigt die Swagger-Oberflรคche die Syntaxhervorhebung nicht mehr an: ... und dann zeigt die Swagger-Oberflรคche die Syntaxhervorhebung nicht mehr an:
@ -31,7 +31,7 @@ Sie kรถnnen sie jedoch deaktivieren, indem Sie `syntaxHighlight` auf `False` set
Auf die gleiche Weise kรถnnten Sie das Theme der Syntaxhervorhebung mit dem Schlรผssel `syntaxHighlight.theme` festlegen (beachten Sie, dass er einen Punkt in der Mitte hat): Auf die gleiche Weise kรถnnten Sie das Theme der Syntaxhervorhebung mit dem Schlรผssel `syntaxHighlight.theme` festlegen (beachten Sie, dass er einen Punkt in der Mitte hat):
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/configure_swagger_ui/tutorial002.py!} {!../../docs_src/configure_swagger_ui/tutorial002.py!}
``` ```
Obige Konfiguration wรผrde das Theme fรผr die Farbe der Syntaxhervorhebung รคndern: Obige Konfiguration wรผrde das Theme fรผr die Farbe der Syntaxhervorhebung รคndern:
@ -45,7 +45,7 @@ FastAPI enthรคlt einige Defaultkonfigurationsparameter, die fรผr die meisten Anw
Es umfasst die folgenden Defaultkonfigurationen: Es umfasst die folgenden Defaultkonfigurationen:
```Python ```Python
{!../../../fastapi/openapi/docs.py[ln:7-23]!} {!../../fastapi/openapi/docs.py[ln:7-23]!}
``` ```
Sie kรถnnen jede davon รผberschreiben, indem Sie im Argument `swagger_ui_parameters` einen anderen Wert festlegen. Sie kรถnnen jede davon รผberschreiben, indem Sie im Argument `swagger_ui_parameters` einen anderen Wert festlegen.
@ -53,7 +53,7 @@ Sie kรถnnen jede davon รผberschreiben, indem Sie im Argument `swagger_ui_paramet
Um beispielsweise `deepLinking` zu deaktivieren, kรถnnten Sie folgende Einstellungen an `swagger_ui_parameters` รผbergeben: Um beispielsweise `deepLinking` zu deaktivieren, kรถnnten Sie folgende Einstellungen an `swagger_ui_parameters` รผbergeben:
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/configure_swagger_ui/tutorial003.py!} {!../../docs_src/configure_swagger_ui/tutorial003.py!}
``` ```
## Andere Parameter der Swagger-Oberflรคche ## Andere Parameter der Swagger-Oberflรคche

14
docs/de/docs/how-to/custom-docs-ui-assets.md

@ -19,7 +19,7 @@ Der erste Schritt besteht darin, die automatischen Dokumentationen zu deaktivier
Um diese zu deaktivieren, setzen Sie deren URLs beim Erstellen Ihrer `FastAPI`-App auf `None`: Um diese zu deaktivieren, setzen Sie deren URLs beim Erstellen Ihrer `FastAPI`-App auf `None`:
```Python hl_lines="8" ```Python hl_lines="8"
{!../../../docs_src/custom_docs_ui/tutorial001.py!} {!../../docs_src/custom_docs_ui/tutorial001.py!}
``` ```
### Die benutzerdefinierten Dokumentationen hinzufรผgen ### Die benutzerdefinierten Dokumentationen hinzufรผgen
@ -37,7 +37,7 @@ Sie kรถnnen die internen Funktionen von FastAPI wiederverwenden, um die HTML-Sei
Und genau so fรผr ReDoc ... Und genau so fรผr ReDoc ...
```Python hl_lines="2-6 11-19 22-24 27-33" ```Python hl_lines="2-6 11-19 22-24 27-33"
{!../../../docs_src/custom_docs_ui/tutorial001.py!} {!../../docs_src/custom_docs_ui/tutorial001.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -55,7 +55,7 @@ Swagger UI erledigt das hinter den Kulissen fรผr Sie, benรถtigt aber diesen โ€žU
Um nun testen zu kรถnnen, ob alles funktioniert, erstellen Sie eine *Pfadoperation*: Um nun testen zu kรถnnen, ob alles funktioniert, erstellen Sie eine *Pfadoperation*:
```Python hl_lines="36-38" ```Python hl_lines="36-38"
{!../../../docs_src/custom_docs_ui/tutorial001.py!} {!../../docs_src/custom_docs_ui/tutorial001.py!}
``` ```
### Es ausprobieren ### Es ausprobieren
@ -125,7 +125,7 @@ Danach kรถnnte Ihre Dateistruktur wie folgt aussehen:
* โ€žMountenโ€œ Sie eine `StaticFiles()`-Instanz in einem bestimmten Pfad. * โ€žMountenโ€œ Sie eine `StaticFiles()`-Instanz in einem bestimmten Pfad.
```Python hl_lines="7 11" ```Python hl_lines="7 11"
{!../../../docs_src/custom_docs_ui/tutorial002.py!} {!../../docs_src/custom_docs_ui/tutorial002.py!}
``` ```
### Die statischen Dateien testen ### Die statischen Dateien testen
@ -159,7 +159,7 @@ Wie bei der Verwendung eines benutzerdefinierten CDN besteht der erste Schritt d
Um diese zu deaktivieren, setzen Sie deren URLs beim Erstellen Ihrer `FastAPI`-App auf `None`: Um diese zu deaktivieren, setzen Sie deren URLs beim Erstellen Ihrer `FastAPI`-App auf `None`:
```Python hl_lines="9" ```Python hl_lines="9"
{!../../../docs_src/custom_docs_ui/tutorial002.py!} {!../../docs_src/custom_docs_ui/tutorial002.py!}
``` ```
### Die benutzerdefinierten Dokumentationen, mit statischen Dateien, hinzufรผgen ### Die benutzerdefinierten Dokumentationen, mit statischen Dateien, hinzufรผgen
@ -177,7 +177,7 @@ Auch hier kรถnnen Sie die internen Funktionen von FastAPI wiederverwenden, um di
Und genau so fรผr ReDoc ... Und genau so fรผr ReDoc ...
```Python hl_lines="2-6 14-22 25-27 30-36" ```Python hl_lines="2-6 14-22 25-27 30-36"
{!../../../docs_src/custom_docs_ui/tutorial002.py!} {!../../docs_src/custom_docs_ui/tutorial002.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -195,7 +195,7 @@ Swagger UI erledigt das hinter den Kulissen fรผr Sie, benรถtigt aber diesen โ€žU
Um nun testen zu kรถnnen, ob alles funktioniert, erstellen Sie eine *Pfadoperation*: Um nun testen zu kรถnnen, ob alles funktioniert, erstellen Sie eine *Pfadoperation*:
```Python hl_lines="39-41" ```Python hl_lines="39-41"
{!../../../docs_src/custom_docs_ui/tutorial002.py!} {!../../docs_src/custom_docs_ui/tutorial002.py!}
``` ```
### Benutzeroberflรคche, mit statischen Dateien, testen ### Benutzeroberflรคche, mit statischen Dateien, testen

12
docs/de/docs/how-to/custom-request-and-route.md

@ -43,7 +43,7 @@ Wenn der Header kein `gzip` enthรคlt, wird nicht versucht, den Body zu dekomprim
Auf diese Weise kann dieselbe Routenklasse gzip-komprimierte oder unkomprimierte Requests verarbeiten. Auf diese Weise kann dieselbe Routenklasse gzip-komprimierte oder unkomprimierte Requests verarbeiten.
```Python hl_lines="8-15" ```Python hl_lines="8-15"
{!../../../docs_src/custom_request_and_route/tutorial001.py!} {!../../docs_src/custom_request_and_route/tutorial001.py!}
``` ```
### Eine benutzerdefinierte `GzipRoute`-Klasse erstellen ### Eine benutzerdefinierte `GzipRoute`-Klasse erstellen
@ -57,7 +57,7 @@ Diese Methode gibt eine Funktion zurรผck. Und diese Funktion empfรคngt einen Req
Hier verwenden wir sie, um aus dem ursprรผnglichen Request einen `GzipRequest` zu erstellen. Hier verwenden wir sie, um aus dem ursprรผnglichen Request einen `GzipRequest` zu erstellen.
```Python hl_lines="18-26" ```Python hl_lines="18-26"
{!../../../docs_src/custom_request_and_route/tutorial001.py!} {!../../docs_src/custom_request_and_route/tutorial001.py!}
``` ```
/// note | "Technische Details" /// note | "Technische Details"
@ -97,13 +97,13 @@ Wir kรถnnen denselben Ansatz auch verwenden, um in einem Exceptionhandler auf de
Alles, was wir tun mรผssen, ist, den Request innerhalb eines `try`/`except`-Blocks zu handhaben: Alles, was wir tun mรผssen, ist, den Request innerhalb eines `try`/`except`-Blocks zu handhaben:
```Python hl_lines="13 15" ```Python hl_lines="13 15"
{!../../../docs_src/custom_request_and_route/tutorial002.py!} {!../../docs_src/custom_request_and_route/tutorial002.py!}
``` ```
Wenn eine Exception auftritt, befindet sich die `Request`-Instanz weiterhin im Gรผltigkeitsbereich, sodass wir den Requestbody lesen und bei der Fehlerbehandlung verwenden kรถnnen: Wenn eine Exception auftritt, befindet sich die `Request`-Instanz weiterhin im Gรผltigkeitsbereich, sodass wir den Requestbody lesen und bei der Fehlerbehandlung verwenden kรถnnen:
```Python hl_lines="16-18" ```Python hl_lines="16-18"
{!../../../docs_src/custom_request_and_route/tutorial002.py!} {!../../docs_src/custom_request_and_route/tutorial002.py!}
``` ```
## Benutzerdefinierte `APIRoute`-Klasse in einem Router ## Benutzerdefinierte `APIRoute`-Klasse in einem Router
@ -111,11 +111,11 @@ Wenn eine Exception auftritt, befindet sich die `Request`-Instanz weiterhin im G
Sie kรถnnen auch den Parameter `route_class` eines `APIRouter` festlegen: Sie kรถnnen auch den Parameter `route_class` eines `APIRouter` festlegen:
```Python hl_lines="26" ```Python hl_lines="26"
{!../../../docs_src/custom_request_and_route/tutorial003.py!} {!../../docs_src/custom_request_and_route/tutorial003.py!}
``` ```
In diesem Beispiel verwenden die *Pfadoperationen* unter dem `router` die benutzerdefinierte `TimedRoute`-Klasse und haben in der Response einen zusรคtzlichen `X-Response-Time`-Header mit der Zeit, die zum Generieren der Response benรถtigt wurde: In diesem Beispiel verwenden die *Pfadoperationen* unter dem `router` die benutzerdefinierte `TimedRoute`-Klasse und haben in der Response einen zusรคtzlichen `X-Response-Time`-Header mit der Zeit, die zum Generieren der Response benรถtigt wurde:
```Python hl_lines="13-20" ```Python hl_lines="13-20"
{!../../../docs_src/custom_request_and_route/tutorial003.py!} {!../../docs_src/custom_request_and_route/tutorial003.py!}
``` ```

10
docs/de/docs/how-to/extending-openapi.md

@ -44,7 +44,7 @@ Fรผgen wir beispielsweise <a href="https://github.com/Rebilly/ReDoc/blob/master/
Schreiben Sie zunรคchst wie gewohnt Ihre ganze **FastAPI**-Anwendung: Schreiben Sie zunรคchst wie gewohnt Ihre ganze **FastAPI**-Anwendung:
```Python hl_lines="1 4 7-9" ```Python hl_lines="1 4 7-9"
{!../../../docs_src/extending_openapi/tutorial001.py!} {!../../docs_src/extending_openapi/tutorial001.py!}
``` ```
### Das OpenAPI-Schema generieren ### Das OpenAPI-Schema generieren
@ -52,7 +52,7 @@ Schreiben Sie zunรคchst wie gewohnt Ihre ganze **FastAPI**-Anwendung:
Verwenden Sie dann dieselbe Hilfsfunktion, um das OpenAPI-Schema innerhalb einer `custom_openapi()`-Funktion zu generieren: Verwenden Sie dann dieselbe Hilfsfunktion, um das OpenAPI-Schema innerhalb einer `custom_openapi()`-Funktion zu generieren:
```Python hl_lines="2 15-21" ```Python hl_lines="2 15-21"
{!../../../docs_src/extending_openapi/tutorial001.py!} {!../../docs_src/extending_openapi/tutorial001.py!}
``` ```
### Das OpenAPI-Schema รคndern ### Das OpenAPI-Schema รคndern
@ -60,7 +60,7 @@ Verwenden Sie dann dieselbe Hilfsfunktion, um das OpenAPI-Schema innerhalb einer
Jetzt kรถnnen Sie die ReDoc-Erweiterung hinzufรผgen und dem `info`-โ€žObjektโ€œ im OpenAPI-Schema ein benutzerdefiniertes `x-logo` hinzufรผgen: Jetzt kรถnnen Sie die ReDoc-Erweiterung hinzufรผgen und dem `info`-โ€žObjektโ€œ im OpenAPI-Schema ein benutzerdefiniertes `x-logo` hinzufรผgen:
```Python hl_lines="22-24" ```Python hl_lines="22-24"
{!../../../docs_src/extending_openapi/tutorial001.py!} {!../../docs_src/extending_openapi/tutorial001.py!}
``` ```
### Zwischenspeichern des OpenAPI-Schemas ### Zwischenspeichern des OpenAPI-Schemas
@ -72,7 +72,7 @@ Auf diese Weise muss Ihre Anwendung das Schema nicht jedes Mal generieren, wenn
Es wird nur einmal generiert und dann wird dasselbe zwischengespeicherte Schema fรผr die nรคchsten Requests verwendet. Es wird nur einmal generiert und dann wird dasselbe zwischengespeicherte Schema fรผr die nรคchsten Requests verwendet.
```Python hl_lines="13-14 25-26" ```Python hl_lines="13-14 25-26"
{!../../../docs_src/extending_openapi/tutorial001.py!} {!../../docs_src/extending_openapi/tutorial001.py!}
``` ```
### Die Methode รผberschreiben ### Die Methode รผberschreiben
@ -80,7 +80,7 @@ Es wird nur einmal generiert und dann wird dasselbe zwischengespeicherte Schema
Jetzt kรถnnen Sie die Methode `.openapi()` durch Ihre neue Funktion ersetzen. Jetzt kรถnnen Sie die Methode `.openapi()` durch Ihre neue Funktion ersetzen.
```Python hl_lines="29" ```Python hl_lines="29"
{!../../../docs_src/extending_openapi/tutorial001.py!} {!../../docs_src/extending_openapi/tutorial001.py!}
``` ```
### Testen ### Testen

2
docs/de/docs/how-to/graphql.md

@ -36,7 +36,7 @@ Abhรคngig von Ihrem Anwendungsfall bevorzugen Sie vielleicht eine andere Bibliot
Hier ist eine kleine Vorschau, wie Sie Strawberry mit FastAPI integrieren kรถnnen: Hier ist eine kleine Vorschau, wie Sie Strawberry mit FastAPI integrieren kรถnnen:
```Python hl_lines="3 22 25-26" ```Python hl_lines="3 22 25-26"
{!../../../docs_src/graphql/tutorial001.py!} {!../../docs_src/graphql/tutorial001.py!}
``` ```
Weitere Informationen zu Strawberry finden Sie in der <a href="https://strawberry.rocks/" class="external-link" target="_blank">Strawberry-Dokumentation</a>. Weitere Informationen zu Strawberry finden Sie in der <a href="https://strawberry.rocks/" class="external-link" target="_blank">Strawberry-Dokumentation</a>.

36
docs/de/docs/how-to/separate-openapi-schemas.md

@ -13,7 +13,7 @@ Nehmen wir an, Sie haben ein Pydantic-Modell mit Defaultwerten wie dieses:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py310.py[ln:1-7]!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py310.py[ln:1-7]!}
# Code unterhalb weggelassen ๐Ÿ‘‡ # Code unterhalb weggelassen ๐Ÿ‘‡
``` ```
@ -22,7 +22,7 @@ Nehmen wir an, Sie haben ein Pydantic-Modell mit Defaultwerten wie dieses:
<summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary> <summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary>
```Python ```Python
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py310.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py310.py!}
``` ```
</details> </details>
@ -32,7 +32,7 @@ Nehmen wir an, Sie haben ein Pydantic-Modell mit Defaultwerten wie dieses:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py39.py[ln:1-9]!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py39.py[ln:1-9]!}
# Code unterhalb weggelassen ๐Ÿ‘‡ # Code unterhalb weggelassen ๐Ÿ‘‡
``` ```
@ -41,7 +41,7 @@ Nehmen wir an, Sie haben ein Pydantic-Modell mit Defaultwerten wie dieses:
<summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary> <summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary>
```Python ```Python
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py39.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py39.py!}
``` ```
</details> </details>
@ -51,7 +51,7 @@ Nehmen wir an, Sie haben ein Pydantic-Modell mit Defaultwerten wie dieses:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/separate_openapi_schemas/tutorial001.py[ln:1-9]!} {!> ../../docs_src/separate_openapi_schemas/tutorial001.py[ln:1-9]!}
# Code unterhalb weggelassen ๐Ÿ‘‡ # Code unterhalb weggelassen ๐Ÿ‘‡
``` ```
@ -60,7 +60,7 @@ Nehmen wir an, Sie haben ein Pydantic-Modell mit Defaultwerten wie dieses:
<summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary> <summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary>
```Python ```Python
{!> ../../../docs_src/separate_openapi_schemas/tutorial001.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial001.py!}
``` ```
</details> </details>
@ -74,7 +74,7 @@ Wenn Sie dieses Modell wie hier als Eingabe verwenden:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="14" ```Python hl_lines="14"
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py310.py[ln:1-15]!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py310.py[ln:1-15]!}
# Code unterhalb weggelassen ๐Ÿ‘‡ # Code unterhalb weggelassen ๐Ÿ‘‡
``` ```
@ -83,7 +83,7 @@ Wenn Sie dieses Modell wie hier als Eingabe verwenden:
<summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary> <summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary>
```Python ```Python
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py310.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py310.py!}
``` ```
</details> </details>
@ -93,7 +93,7 @@ Wenn Sie dieses Modell wie hier als Eingabe verwenden:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="16" ```Python hl_lines="16"
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py39.py[ln:1-17]!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py39.py[ln:1-17]!}
# Code unterhalb weggelassen ๐Ÿ‘‡ # Code unterhalb weggelassen ๐Ÿ‘‡
``` ```
@ -102,7 +102,7 @@ Wenn Sie dieses Modell wie hier als Eingabe verwenden:
<summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary> <summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary>
```Python ```Python
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py39.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py39.py!}
``` ```
</details> </details>
@ -112,7 +112,7 @@ Wenn Sie dieses Modell wie hier als Eingabe verwenden:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="16" ```Python hl_lines="16"
{!> ../../../docs_src/separate_openapi_schemas/tutorial001.py[ln:1-17]!} {!> ../../docs_src/separate_openapi_schemas/tutorial001.py[ln:1-17]!}
# Code unterhalb weggelassen ๐Ÿ‘‡ # Code unterhalb weggelassen ๐Ÿ‘‡
``` ```
@ -121,7 +121,7 @@ Wenn Sie dieses Modell wie hier als Eingabe verwenden:
<summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary> <summary>๐Ÿ‘€ Vollstรคndige Dateivorschau</summary>
```Python ```Python
{!> ../../../docs_src/separate_openapi_schemas/tutorial001.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial001.py!}
``` ```
</details> </details>
@ -145,7 +145,7 @@ Wenn Sie jedoch dasselbe Modell als Ausgabe verwenden, wie hier:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py310.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py310.py!}
``` ```
//// ////
@ -153,7 +153,7 @@ Wenn Sie jedoch dasselbe Modell als Ausgabe verwenden, wie hier:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="21" ```Python hl_lines="21"
{!> ../../../docs_src/separate_openapi_schemas/tutorial001_py39.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial001_py39.py!}
``` ```
//// ////
@ -161,7 +161,7 @@ Wenn Sie jedoch dasselbe Modell als Ausgabe verwenden, wie hier:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="21" ```Python hl_lines="21"
{!> ../../../docs_src/separate_openapi_schemas/tutorial001.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial001.py!}
``` ```
//// ////
@ -226,7 +226,7 @@ Unterstรผtzung fรผr `separate_input_output_schemas` wurde in FastAPI `0.102.0` h
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/separate_openapi_schemas/tutorial002_py310.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial002_py310.py!}
``` ```
//// ////
@ -234,7 +234,7 @@ Unterstรผtzung fรผr `separate_input_output_schemas` wurde in FastAPI `0.102.0` h
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/separate_openapi_schemas/tutorial002_py39.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial002_py39.py!}
``` ```
//// ////
@ -242,7 +242,7 @@ Unterstรผtzung fรผr `separate_input_output_schemas` wurde in FastAPI `0.102.0` h
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/separate_openapi_schemas/tutorial002.py!} {!> ../../docs_src/separate_openapi_schemas/tutorial002.py!}
``` ```
//// ////

56
docs/de/docs/python-types.md

@ -23,7 +23,7 @@ Wenn Sie ein Python-Experte sind und bereits alles รผber Typhinweise wissen, รผb
Fangen wir mit einem einfachen Beispiel an: Fangen wir mit einem einfachen Beispiel an:
```Python ```Python
{!../../../docs_src/python_types/tutorial001.py!} {!../../docs_src/python_types/tutorial001.py!}
``` ```
Dieses Programm gibt aus: Dieses Programm gibt aus:
@ -39,7 +39,7 @@ Die Funktion macht Folgendes:
* <abbr title="Fรผge zu einer Einheit zusammen, eins nach dem anderen.">Verkettet</abbr> sie mit einem Leerzeichen in der Mitte. * <abbr title="Fรผge zu einer Einheit zusammen, eins nach dem anderen.">Verkettet</abbr> sie mit einem Leerzeichen in der Mitte.
```Python hl_lines="2" ```Python hl_lines="2"
{!../../../docs_src/python_types/tutorial001.py!} {!../../docs_src/python_types/tutorial001.py!}
``` ```
### Bearbeiten Sie es ### Bearbeiten Sie es
@ -83,7 +83,7 @@ Das war's.
Das sind die โ€žTyphinweiseโ€œ: Das sind die โ€žTyphinweiseโ€œ:
```Python hl_lines="1" ```Python hl_lines="1"
{!../../../docs_src/python_types/tutorial002.py!} {!../../docs_src/python_types/tutorial002.py!}
``` ```
Das ist nicht das gleiche wie das Deklarieren von Defaultwerten, wie es hier der Fall ist: Das ist nicht das gleiche wie das Deklarieren von Defaultwerten, wie es hier der Fall ist:
@ -113,7 +113,7 @@ Hier kรถnnen Sie durch die Optionen blรคttern, bis Sie diejenige finden, bei der
Sehen Sie sich diese Funktion an, sie hat bereits Typhinweise: Sehen Sie sich diese Funktion an, sie hat bereits Typhinweise:
```Python hl_lines="1" ```Python hl_lines="1"
{!../../../docs_src/python_types/tutorial003.py!} {!../../docs_src/python_types/tutorial003.py!}
``` ```
Da der Editor die Typen der Variablen kennt, erhalten Sie nicht nur Code-Vervollstรคndigung, sondern auch eine Fehlerprรผfung: Da der Editor die Typen der Variablen kennt, erhalten Sie nicht nur Code-Vervollstรคndigung, sondern auch eine Fehlerprรผfung:
@ -123,7 +123,7 @@ Da der Editor die Typen der Variablen kennt, erhalten Sie nicht nur Code-Vervoll
Jetzt, da Sie wissen, dass Sie das reparieren mรผssen, konvertieren Sie `age` mittels `str(age)` in einen String: Jetzt, da Sie wissen, dass Sie das reparieren mรผssen, konvertieren Sie `age` mittels `str(age)` in einen String:
```Python hl_lines="2" ```Python hl_lines="2"
{!../../../docs_src/python_types/tutorial004.py!} {!../../docs_src/python_types/tutorial004.py!}
``` ```
## Deklarieren von Typen ## Deklarieren von Typen
@ -144,7 +144,7 @@ Zum Beispiel diese:
* `bytes` * `bytes`
```Python hl_lines="1" ```Python hl_lines="1"
{!../../../docs_src/python_types/tutorial005.py!} {!../../docs_src/python_types/tutorial005.py!}
``` ```
### Generische Typen mit Typ-Parametern ### Generische Typen mit Typ-Parametern
@ -182,7 +182,7 @@ Als Typ nehmen Sie `list`.
Da die Liste ein Typ ist, welcher innere Typen enthรคlt, werden diese von eckigen Klammern umfasst: Da die Liste ein Typ ist, welcher innere Typen enthรคlt, werden diese von eckigen Klammern umfasst:
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006_py39.py!} {!> ../../docs_src/python_types/tutorial006_py39.py!}
``` ```
//// ////
@ -192,7 +192,7 @@ Da die Liste ein Typ ist, welcher innere Typen enthรคlt, werden diese von eckige
Von `typing` importieren Sie `List` (mit GroรŸbuchstaben `L`): Von `typing` importieren Sie `List` (mit GroรŸbuchstaben `L`):
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial006.py!} {!> ../../docs_src/python_types/tutorial006.py!}
``` ```
Deklarieren Sie die Variable mit der gleichen Doppelpunkt-Syntax (`:`). Deklarieren Sie die Variable mit der gleichen Doppelpunkt-Syntax (`:`).
@ -202,7 +202,7 @@ Als Typ nehmen Sie das `List`, das Sie von `typing` importiert haben.
Da die Liste ein Typ ist, welcher innere Typen enthรคlt, werden diese von eckigen Klammern umfasst: Da die Liste ein Typ ist, welcher innere Typen enthรคlt, werden diese von eckigen Klammern umfasst:
```Python hl_lines="4" ```Python hl_lines="4"
{!> ../../../docs_src/python_types/tutorial006.py!} {!> ../../docs_src/python_types/tutorial006.py!}
``` ```
//// ////
@ -240,7 +240,7 @@ Das Gleiche gilt fรผr die Deklaration eines Tupels โ€“ `tuple` โ€“ und einer Men
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial007_py39.py!} {!> ../../docs_src/python_types/tutorial007_py39.py!}
``` ```
//// ////
@ -248,7 +248,7 @@ Das Gleiche gilt fรผr die Deklaration eines Tupels โ€“ `tuple` โ€“ und einer Men
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial007.py!} {!> ../../docs_src/python_types/tutorial007.py!}
``` ```
//// ////
@ -269,7 +269,7 @@ Der zweite Typ-Parameter ist fรผr die Werte des `dict`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial008_py39.py!} {!> ../../docs_src/python_types/tutorial008_py39.py!}
``` ```
//// ////
@ -277,7 +277,7 @@ Der zweite Typ-Parameter ist fรผr die Werte des `dict`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial008.py!} {!> ../../docs_src/python_types/tutorial008.py!}
``` ```
//// ////
@ -299,7 +299,7 @@ In Python 3.10 gibt es zusรคtzlich eine **neue Syntax**, die es erlaubt, die mรถ
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial008b_py310.py!} {!> ../../docs_src/python_types/tutorial008b_py310.py!}
``` ```
//// ////
@ -307,7 +307,7 @@ In Python 3.10 gibt es zusรคtzlich eine **neue Syntax**, die es erlaubt, die mรถ
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial008b.py!} {!> ../../docs_src/python_types/tutorial008b.py!}
``` ```
//// ////
@ -321,7 +321,7 @@ Sie kรถnnen deklarieren, dass ein Wert ein `str`, aber vielleicht auch `None` se
In Python 3.6 und darรผber (inklusive Python 3.10) kรถnnen Sie das deklarieren, indem Sie `Optional` vom `typing` Modul importieren und verwenden. In Python 3.6 und darรผber (inklusive Python 3.10) kรถnnen Sie das deklarieren, indem Sie `Optional` vom `typing` Modul importieren und verwenden.
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!../../../docs_src/python_types/tutorial009.py!} {!../../docs_src/python_types/tutorial009.py!}
``` ```
Wenn Sie `Optional[str]` anstelle von nur `str` verwenden, wird Ihr Editor Ihnen dabei helfen, Fehler zu erkennen, bei denen Sie annehmen kรถnnten, dass ein Wert immer eine String (`str`) ist, obwohl er auch `None` sein kรถnnte. Wenn Sie `Optional[str]` anstelle von nur `str` verwenden, wird Ihr Editor Ihnen dabei helfen, Fehler zu erkennen, bei denen Sie annehmen kรถnnten, dass ein Wert immer eine String (`str`) ist, obwohl er auch `None` sein kรถnnte.
@ -333,7 +333,7 @@ Das bedeutet auch, dass Sie in Python 3.10 `Something | None` verwenden kรถnnen:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/python_types/tutorial009_py310.py!} {!> ../../docs_src/python_types/tutorial009_py310.py!}
``` ```
//// ////
@ -341,7 +341,7 @@ Das bedeutet auch, dass Sie in Python 3.10 `Something | None` verwenden kรถnnen:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial009.py!} {!> ../../docs_src/python_types/tutorial009.py!}
``` ```
//// ////
@ -349,7 +349,7 @@ Das bedeutet auch, dass Sie in Python 3.10 `Something | None` verwenden kรถnnen:
//// tab | Python 3.8+ Alternative //// tab | Python 3.8+ Alternative
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial009b.py!} {!> ../../docs_src/python_types/tutorial009b.py!}
``` ```
//// ////
@ -370,7 +370,7 @@ Es geht nur um Wรถrter und Namen. Aber diese Worte kรถnnen beeinflussen, wie Sie
Nehmen wir zum Beispiel diese Funktion: Nehmen wir zum Beispiel diese Funktion:
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!../../../docs_src/python_types/tutorial009c.py!} {!../../docs_src/python_types/tutorial009c.py!}
``` ```
Der Parameter `name` ist definiert als `Optional[str]`, aber er ist **nicht optional**, Sie kรถnnen die Funktion nicht ohne diesen Parameter aufrufen: Der Parameter `name` ist definiert als `Optional[str]`, aber er ist **nicht optional**, Sie kรถnnen die Funktion nicht ohne diesen Parameter aufrufen:
@ -388,7 +388,7 @@ say_hi(name=None) # Das funktioniert, None is gรผltig ๐ŸŽ‰
Die gute Nachricht ist, dass Sie sich darรผber keine Sorgen mehr machen mรผssen, wenn Sie Python 3.10 verwenden, da Sie einfach `|` verwenden kรถnnen, um Vereinigungen von Typen zu definieren: Die gute Nachricht ist, dass Sie sich darรผber keine Sorgen mehr machen mรผssen, wenn Sie Python 3.10 verwenden, da Sie einfach `|` verwenden kรถnnen, um Vereinigungen von Typen zu definieren:
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!../../../docs_src/python_types/tutorial009c_py310.py!} {!../../docs_src/python_types/tutorial009c_py310.py!}
``` ```
Und dann mรผssen Sie sich nicht mehr um Namen wie `Optional` und `Union` kรผmmern. ๐Ÿ˜Ž Und dann mรผssen Sie sich nicht mehr um Namen wie `Optional` und `Union` kรผmmern. ๐Ÿ˜Ž
@ -452,13 +452,13 @@ Sie kรถnnen auch eine Klasse als Typ einer Variablen deklarieren.
Nehmen wir an, Sie haben eine Klasse `Person`, mit einem Namen: Nehmen wir an, Sie haben eine Klasse `Person`, mit einem Namen:
```Python hl_lines="1-3" ```Python hl_lines="1-3"
{!../../../docs_src/python_types/tutorial010.py!} {!../../docs_src/python_types/tutorial010.py!}
``` ```
Dann kรถnnen Sie eine Variable vom Typ `Person` deklarieren: Dann kรถnnen Sie eine Variable vom Typ `Person` deklarieren:
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/python_types/tutorial010.py!} {!../../docs_src/python_types/tutorial010.py!}
``` ```
Und wiederum bekommen Sie die volle Editor-Unterstรผtzung: Und wiederum bekommen Sie die volle Editor-Unterstรผtzung:
@ -486,7 +486,7 @@ Ein Beispiel aus der offiziellen Pydantic Dokumentation:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python ```Python
{!> ../../../docs_src/python_types/tutorial011_py310.py!} {!> ../../docs_src/python_types/tutorial011_py310.py!}
``` ```
//// ////
@ -494,7 +494,7 @@ Ein Beispiel aus der offiziellen Pydantic Dokumentation:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python ```Python
{!> ../../../docs_src/python_types/tutorial011_py39.py!} {!> ../../docs_src/python_types/tutorial011_py39.py!}
``` ```
//// ////
@ -502,7 +502,7 @@ Ein Beispiel aus der offiziellen Pydantic Dokumentation:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python ```Python
{!> ../../../docs_src/python_types/tutorial011.py!} {!> ../../docs_src/python_types/tutorial011.py!}
``` ```
//// ////
@ -532,7 +532,7 @@ Python bietet auch die Mรถglichkeit, **zusรคtzliche Metadaten** in Typhinweisen
In Python 3.9 ist `Annotated` ein Teil der Standardbibliothek, Sie kรถnnen es von `typing` importieren. In Python 3.9 ist `Annotated` ein Teil der Standardbibliothek, Sie kรถnnen es von `typing` importieren.
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial013_py39.py!} {!> ../../docs_src/python_types/tutorial013_py39.py!}
``` ```
//// ////
@ -544,7 +544,7 @@ In Versionen niedriger als Python 3.9 importieren Sie `Annotated` von `typing_ex
Es wird bereits mit **FastAPI** installiert sein. Es wird bereits mit **FastAPI** installiert sein.
```Python hl_lines="1 4" ```Python hl_lines="1 4"
{!> ../../../docs_src/python_types/tutorial013.py!} {!> ../../docs_src/python_types/tutorial013.py!}
``` ```
//// ////

16
docs/de/docs/tutorial/background-tasks.md

@ -16,7 +16,7 @@ Hierzu zรคhlen beispielsweise:
Importieren Sie zunรคchst `BackgroundTasks` und definieren Sie einen Parameter in Ihrer *Pfadoperation-Funktion* mit der Typdeklaration `BackgroundTasks`: Importieren Sie zunรคchst `BackgroundTasks` und definieren Sie einen Parameter in Ihrer *Pfadoperation-Funktion* mit der Typdeklaration `BackgroundTasks`:
```Python hl_lines="1 13" ```Python hl_lines="1 13"
{!../../../docs_src/background_tasks/tutorial001.py!} {!../../docs_src/background_tasks/tutorial001.py!}
``` ```
**FastAPI** erstellt fรผr Sie das Objekt vom Typ `BackgroundTasks` und รผbergibt es als diesen Parameter. **FastAPI** erstellt fรผr Sie das Objekt vom Typ `BackgroundTasks` und รผbergibt es als diesen Parameter.
@ -34,7 +34,7 @@ In diesem Fall schreibt die Taskfunktion in eine Datei (den Versand einer E-Mail
Und da der Schreibvorgang nicht `async` und `await` verwendet, definieren wir die Funktion mit normalem `def`: Und da der Schreibvorgang nicht `async` und `await` verwendet, definieren wir die Funktion mit normalem `def`:
```Python hl_lines="6-9" ```Python hl_lines="6-9"
{!../../../docs_src/background_tasks/tutorial001.py!} {!../../docs_src/background_tasks/tutorial001.py!}
``` ```
## Den Hintergrundtask hinzufรผgen ## Den Hintergrundtask hinzufรผgen
@ -42,7 +42,7 @@ Und da der Schreibvorgang nicht `async` und `await` verwendet, definieren wir di
รœbergeben Sie innerhalb Ihrer *Pfadoperation-Funktion* Ihre Taskfunktion mit der Methode `.add_task()` an das *Hintergrundtasks*-Objekt: รœbergeben Sie innerhalb Ihrer *Pfadoperation-Funktion* Ihre Taskfunktion mit der Methode `.add_task()` an das *Hintergrundtasks*-Objekt:
```Python hl_lines="14" ```Python hl_lines="14"
{!../../../docs_src/background_tasks/tutorial001.py!} {!../../docs_src/background_tasks/tutorial001.py!}
``` ```
`.add_task()` erhรคlt als Argumente: `.add_task()` erhรคlt als Argumente:
@ -60,7 +60,7 @@ Die Verwendung von `BackgroundTasks` funktioniert auch mit dem <abbr title="Einb
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="13 15 22 25" ```Python hl_lines="13 15 22 25"
{!> ../../../docs_src/background_tasks/tutorial002_an_py310.py!} {!> ../../docs_src/background_tasks/tutorial002_an_py310.py!}
``` ```
//// ////
@ -68,7 +68,7 @@ Die Verwendung von `BackgroundTasks` funktioniert auch mit dem <abbr title="Einb
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="13 15 22 25" ```Python hl_lines="13 15 22 25"
{!> ../../../docs_src/background_tasks/tutorial002_an_py39.py!} {!> ../../docs_src/background_tasks/tutorial002_an_py39.py!}
``` ```
//// ////
@ -76,7 +76,7 @@ Die Verwendung von `BackgroundTasks` funktioniert auch mit dem <abbr title="Einb
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="14 16 23 26" ```Python hl_lines="14 16 23 26"
{!> ../../../docs_src/background_tasks/tutorial002_an.py!} {!> ../../docs_src/background_tasks/tutorial002_an.py!}
``` ```
//// ////
@ -90,7 +90,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11 13 20 23" ```Python hl_lines="11 13 20 23"
{!> ../../../docs_src/background_tasks/tutorial002_py310.py!} {!> ../../docs_src/background_tasks/tutorial002_py310.py!}
``` ```
//// ////
@ -104,7 +104,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="13 15 22 25" ```Python hl_lines="13 15 22 25"
{!> ../../../docs_src/background_tasks/tutorial002.py!} {!> ../../docs_src/background_tasks/tutorial002.py!}
``` ```
//// ////

30
docs/de/docs/tutorial/bigger-applications.md

@ -86,7 +86,7 @@ Sie kรถnnen die *Pfadoperationen* fรผr dieses Modul mit `APIRouter` erstellen.
Sie importieren ihn und erstellen eine โ€žInstanzโ€œ auf die gleiche Weise wie mit der Klasse `FastAPI`: Sie importieren ihn und erstellen eine โ€žInstanzโ€œ auf die gleiche Weise wie mit der Klasse `FastAPI`:
```Python hl_lines="1 3" title="app/routers/users.py" ```Python hl_lines="1 3" title="app/routers/users.py"
{!../../../docs_src/bigger_applications/app/routers/users.py!} {!../../docs_src/bigger_applications/app/routers/users.py!}
``` ```
### *Pfadoperationen* mit `APIRouter` ### *Pfadoperationen* mit `APIRouter`
@ -96,7 +96,7 @@ Und dann verwenden Sie ihn, um Ihre *Pfadoperationen* zu deklarieren.
Verwenden Sie ihn auf die gleiche Weise wie die Klasse `FastAPI`: Verwenden Sie ihn auf die gleiche Weise wie die Klasse `FastAPI`:
```Python hl_lines="6 11 16" title="app/routers/users.py" ```Python hl_lines="6 11 16" title="app/routers/users.py"
{!../../../docs_src/bigger_applications/app/routers/users.py!} {!../../docs_src/bigger_applications/app/routers/users.py!}
``` ```
Sie kรถnnen sich `APIRouter` als eine โ€žMini-`FastAPI`โ€œ-Klasse vorstellen. Sie kรถnnen sich `APIRouter` als eine โ€žMini-`FastAPI`โ€œ-Klasse vorstellen.
@ -124,7 +124,7 @@ Wir werden nun eine einfache Abhรคngigkeit verwenden, um einen benutzerdefiniert
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="3 6-8" title="app/dependencies.py" ```Python hl_lines="3 6-8" title="app/dependencies.py"
{!> ../../../docs_src/bigger_applications/app_an_py39/dependencies.py!} {!> ../../docs_src/bigger_applications/app_an_py39/dependencies.py!}
``` ```
//// ////
@ -132,7 +132,7 @@ Wir werden nun eine einfache Abhรคngigkeit verwenden, um einen benutzerdefiniert
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 5-7" title="app/dependencies.py" ```Python hl_lines="1 5-7" title="app/dependencies.py"
{!> ../../../docs_src/bigger_applications/app_an/dependencies.py!} {!> ../../docs_src/bigger_applications/app_an/dependencies.py!}
``` ```
//// ////
@ -146,7 +146,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1 4-6" title="app/dependencies.py" ```Python hl_lines="1 4-6" title="app/dependencies.py"
{!> ../../../docs_src/bigger_applications/app/dependencies.py!} {!> ../../docs_src/bigger_applications/app/dependencies.py!}
``` ```
//// ////
@ -182,7 +182,7 @@ Wir wissen, dass alle *Pfadoperationen* in diesem Modul folgendes haben:
Anstatt also alles zu jeder *Pfadoperation* hinzuzufรผgen, kรถnnen wir es dem `APIRouter` hinzufรผgen. Anstatt also alles zu jeder *Pfadoperation* hinzuzufรผgen, kรถnnen wir es dem `APIRouter` hinzufรผgen.
```Python hl_lines="5-10 16 21" title="app/routers/items.py" ```Python hl_lines="5-10 16 21" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!} {!../../docs_src/bigger_applications/app/routers/items.py!}
``` ```
Da der Pfad jeder *Pfadoperation* mit `/` beginnen muss, wie in: Da der Pfad jeder *Pfadoperation* mit `/` beginnen muss, wie in:
@ -243,7 +243,7 @@ Und wir mรผssen die Abhรคngigkeitsfunktion aus dem Modul `app.dependencies` impo
Daher verwenden wir einen relativen Import mit `..` fรผr die Abhรคngigkeiten: Daher verwenden wir einen relativen Import mit `..` fรผr die Abhรคngigkeiten:
```Python hl_lines="3" title="app/routers/items.py" ```Python hl_lines="3" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!} {!../../docs_src/bigger_applications/app/routers/items.py!}
``` ```
#### Wie relative Importe funktionieren #### Wie relative Importe funktionieren
@ -316,7 +316,7 @@ Wir fรผgen weder das Prรคfix `/items` noch `tags=["items"]` zu jeder *Pfadoperat
Aber wir kรถnnen immer noch _mehr_ `tags` hinzufรผgen, die auf eine bestimmte *Pfadoperation* angewendet werden, sowie einige zusรคtzliche `responses`, die speziell fรผr diese *Pfadoperation* gelten: Aber wir kรถnnen immer noch _mehr_ `tags` hinzufรผgen, die auf eine bestimmte *Pfadoperation* angewendet werden, sowie einige zusรคtzliche `responses`, die speziell fรผr diese *Pfadoperation* gelten:
```Python hl_lines="30-31" title="app/routers/items.py" ```Python hl_lines="30-31" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!} {!../../docs_src/bigger_applications/app/routers/items.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -344,7 +344,7 @@ Sie importieren und erstellen wie gewohnt eine `FastAPI`-Klasse.
Und wir kรถnnen sogar [globale Abhรคngigkeiten](dependencies/global-dependencies.md){.internal-link target=_blank} deklarieren, die mit den Abhรคngigkeiten fรผr jeden `APIRouter` kombiniert werden: Und wir kรถnnen sogar [globale Abhรคngigkeiten](dependencies/global-dependencies.md){.internal-link target=_blank} deklarieren, die mit den Abhรคngigkeiten fรผr jeden `APIRouter` kombiniert werden:
```Python hl_lines="1 3 7" title="app/main.py" ```Python hl_lines="1 3 7" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!} {!../../docs_src/bigger_applications/app/main.py!}
``` ```
### Den `APIRouter` importieren ### Den `APIRouter` importieren
@ -352,7 +352,7 @@ Und wir kรถnnen sogar [globale Abhรคngigkeiten](dependencies/global-dependencies
Jetzt importieren wir die anderen Submodule, die `APIRouter` haben: Jetzt importieren wir die anderen Submodule, die `APIRouter` haben:
```Python hl_lines="4-5" title="app/main.py" ```Python hl_lines="4-5" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!} {!../../docs_src/bigger_applications/app/main.py!}
``` ```
Da es sich bei den Dateien `app/routers/users.py` und `app/routers/items.py` um Submodule handelt, die Teil desselben Python-Packages `app` sind, kรถnnen wir einen einzelnen Punkt `.` verwenden, um sie mit โ€žrelativen Importsโ€œ zu importieren. Da es sich bei den Dateien `app/routers/users.py` und `app/routers/items.py` um Submodule handelt, die Teil desselben Python-Packages `app` sind, kรถnnen wir einen einzelnen Punkt `.` verwenden, um sie mit โ€žrelativen Importsโ€œ zu importieren.
@ -417,7 +417,7 @@ wรผrde der `router` von `users` den von `items` รผberschreiben und wir kรถnnten
Um also beide in derselben Datei verwenden zu kรถnnen, importieren wir die Submodule direkt: Um also beide in derselben Datei verwenden zu kรถnnen, importieren wir die Submodule direkt:
```Python hl_lines="5" title="app/main.py" ```Python hl_lines="5" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!} {!../../docs_src/bigger_applications/app/main.py!}
``` ```
@ -426,7 +426,7 @@ Um also beide in derselben Datei verwenden zu kรถnnen, importieren wir die Submo
Inkludieren wir nun die `router` aus diesen Submodulen `users` und `items`: Inkludieren wir nun die `router` aus diesen Submodulen `users` und `items`:
```Python hl_lines="10-11" title="app/main.py" ```Python hl_lines="10-11" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!} {!../../docs_src/bigger_applications/app/main.py!}
``` ```
/// info /// info
@ -468,7 +468,7 @@ Sie enthรคlt einen `APIRouter` mit einigen administrativen *Pfadoperationen*, di
In diesem Beispiel wird es ganz einfach sein. Nehmen wir jedoch an, dass wir, da sie mit anderen Projekten in der Organisation geteilt wird, sie nicht รคndern und kein `prefix`, `dependencies`, `tags`, usw. direkt zum `APIRouter` hinzufรผgen kรถnnen: In diesem Beispiel wird es ganz einfach sein. Nehmen wir jedoch an, dass wir, da sie mit anderen Projekten in der Organisation geteilt wird, sie nicht รคndern und kein `prefix`, `dependencies`, `tags`, usw. direkt zum `APIRouter` hinzufรผgen kรถnnen:
```Python hl_lines="3" title="app/internal/admin.py" ```Python hl_lines="3" title="app/internal/admin.py"
{!../../../docs_src/bigger_applications/app/internal/admin.py!} {!../../docs_src/bigger_applications/app/internal/admin.py!}
``` ```
Aber wir mรถchten immer noch ein benutzerdefiniertes `prefix` festlegen, wenn wir den `APIRouter` einbinden, sodass alle seine *Pfadoperationen* mit `/admin` beginnen, wir mรถchten es mit den `dependencies` sichern, die wir bereits fรผr dieses Projekt haben, und wir mรถchten `tags` und `responses` hinzufรผgen. Aber wir mรถchten immer noch ein benutzerdefiniertes `prefix` festlegen, wenn wir den `APIRouter` einbinden, sodass alle seine *Pfadoperationen* mit `/admin` beginnen, wir mรถchten es mit den `dependencies` sichern, die wir bereits fรผr dieses Projekt haben, und wir mรถchten `tags` und `responses` hinzufรผgen.
@ -476,7 +476,7 @@ Aber wir mรถchten immer noch ein benutzerdefiniertes `prefix` festlegen, wenn wi
Wir kรถnnen das alles deklarieren, ohne den ursprรผnglichen `APIRouter` รคndern zu mรผssen, indem wir diese Parameter an `app.include_router()` รผbergeben: Wir kรถnnen das alles deklarieren, ohne den ursprรผnglichen `APIRouter` รคndern zu mรผssen, indem wir diese Parameter an `app.include_router()` รผbergeben:
```Python hl_lines="14-17" title="app/main.py" ```Python hl_lines="14-17" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!} {!../../docs_src/bigger_applications/app/main.py!}
``` ```
Auf diese Weise bleibt der ursprรผngliche `APIRouter` unverรคndert, sodass wir dieselbe `app/internal/admin.py`-Datei weiterhin mit anderen Projekten in der Organisation teilen kรถnnen. Auf diese Weise bleibt der ursprรผngliche `APIRouter` unverรคndert, sodass wir dieselbe `app/internal/admin.py`-Datei weiterhin mit anderen Projekten in der Organisation teilen kรถnnen.
@ -499,7 +499,7 @@ Wir kรถnnen *Pfadoperationen* auch direkt zur `FastAPI`-App hinzufรผgen.
Hier machen wir es ... nur um zu zeigen, dass wir es kรถnnen ๐Ÿคท: Hier machen wir es ... nur um zu zeigen, dass wir es kรถnnen ๐Ÿคท:
```Python hl_lines="21-23" title="app/main.py" ```Python hl_lines="21-23" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!} {!../../docs_src/bigger_applications/app/main.py!}
``` ```
und es wird korrekt funktionieren, zusammen mit allen anderen *Pfadoperationen*, die mit `app.include_router()` hinzugefรผgt wurden. und es wird korrekt funktionieren, zusammen mit allen anderen *Pfadoperationen*, die mit `app.include_router()` hinzugefรผgt wurden.

20
docs/de/docs/tutorial/body-fields.md

@ -9,7 +9,7 @@ Importieren Sie es zuerst:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="4" ```Python hl_lines="4"
{!> ../../../docs_src/body_fields/tutorial001_an_py310.py!} {!> ../../docs_src/body_fields/tutorial001_an_py310.py!}
``` ```
//// ////
@ -17,7 +17,7 @@ Importieren Sie es zuerst:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="4" ```Python hl_lines="4"
{!> ../../../docs_src/body_fields/tutorial001_an_py39.py!} {!> ../../docs_src/body_fields/tutorial001_an_py39.py!}
``` ```
//// ////
@ -25,7 +25,7 @@ Importieren Sie es zuerst:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="4" ```Python hl_lines="4"
{!> ../../../docs_src/body_fields/tutorial001_an.py!} {!> ../../docs_src/body_fields/tutorial001_an.py!}
``` ```
//// ////
@ -39,7 +39,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="2" ```Python hl_lines="2"
{!> ../../../docs_src/body_fields/tutorial001_py310.py!} {!> ../../docs_src/body_fields/tutorial001_py310.py!}
``` ```
//// ////
@ -53,7 +53,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="4" ```Python hl_lines="4"
{!> ../../../docs_src/body_fields/tutorial001.py!} {!> ../../docs_src/body_fields/tutorial001.py!}
``` ```
//// ////
@ -71,7 +71,7 @@ Dann kรถnnen Sie `Field` mit Modellattributen deklarieren:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="11-14" ```Python hl_lines="11-14"
{!> ../../../docs_src/body_fields/tutorial001_an_py310.py!} {!> ../../docs_src/body_fields/tutorial001_an_py310.py!}
``` ```
//// ////
@ -79,7 +79,7 @@ Dann kรถnnen Sie `Field` mit Modellattributen deklarieren:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="11-14" ```Python hl_lines="11-14"
{!> ../../../docs_src/body_fields/tutorial001_an_py39.py!} {!> ../../docs_src/body_fields/tutorial001_an_py39.py!}
``` ```
//// ////
@ -87,7 +87,7 @@ Dann kรถnnen Sie `Field` mit Modellattributen deklarieren:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="12-15" ```Python hl_lines="12-15"
{!> ../../../docs_src/body_fields/tutorial001_an.py!} {!> ../../docs_src/body_fields/tutorial001_an.py!}
``` ```
//// ////
@ -101,7 +101,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9-12" ```Python hl_lines="9-12"
{!> ../../../docs_src/body_fields/tutorial001_py310.py!} {!> ../../docs_src/body_fields/tutorial001_py310.py!}
``` ```
//// ////
@ -115,7 +115,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11-14" ```Python hl_lines="11-14"
{!> ../../../docs_src/body_fields/tutorial001.py!} {!> ../../docs_src/body_fields/tutorial001.py!}
``` ```
//// ////

44
docs/de/docs/tutorial/body-multiple-params.md

@ -11,7 +11,7 @@ Und Sie kรถnnen auch Body-Parameter als optional kennzeichnen, indem Sie den Def
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="18-20" ```Python hl_lines="18-20"
{!> ../../../docs_src/body_multiple_params/tutorial001_an_py310.py!} {!> ../../docs_src/body_multiple_params/tutorial001_an_py310.py!}
``` ```
//// ////
@ -19,7 +19,7 @@ Und Sie kรถnnen auch Body-Parameter als optional kennzeichnen, indem Sie den Def
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="18-20" ```Python hl_lines="18-20"
{!> ../../../docs_src/body_multiple_params/tutorial001_an_py39.py!} {!> ../../docs_src/body_multiple_params/tutorial001_an_py39.py!}
``` ```
//// ////
@ -27,7 +27,7 @@ Und Sie kรถnnen auch Body-Parameter als optional kennzeichnen, indem Sie den Def
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="19-21" ```Python hl_lines="19-21"
{!> ../../../docs_src/body_multiple_params/tutorial001_an.py!} {!> ../../docs_src/body_multiple_params/tutorial001_an.py!}
``` ```
//// ////
@ -41,7 +41,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="17-19" ```Python hl_lines="17-19"
{!> ../../../docs_src/body_multiple_params/tutorial001_py310.py!} {!> ../../docs_src/body_multiple_params/tutorial001_py310.py!}
``` ```
//// ////
@ -55,7 +55,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="19-21" ```Python hl_lines="19-21"
{!> ../../../docs_src/body_multiple_params/tutorial001.py!} {!> ../../docs_src/body_multiple_params/tutorial001.py!}
``` ```
//// ////
@ -84,7 +84,7 @@ Aber Sie kรถnnen auch mehrere Body-Parameter deklarieren, z. B. `item` und `user
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/body_multiple_params/tutorial002_py310.py!} {!> ../../docs_src/body_multiple_params/tutorial002_py310.py!}
``` ```
//// ////
@ -92,7 +92,7 @@ Aber Sie kรถnnen auch mehrere Body-Parameter deklarieren, z. B. `item` und `user
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="22" ```Python hl_lines="22"
{!> ../../../docs_src/body_multiple_params/tutorial002.py!} {!> ../../docs_src/body_multiple_params/tutorial002.py!}
``` ```
//// ////
@ -139,7 +139,7 @@ Aber Sie kรถnnen **FastAPI** instruieren, ihn als weiteren Body-Schlรผssel zu er
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="23" ```Python hl_lines="23"
{!> ../../../docs_src/body_multiple_params/tutorial003_an_py310.py!} {!> ../../docs_src/body_multiple_params/tutorial003_an_py310.py!}
``` ```
//// ////
@ -147,7 +147,7 @@ Aber Sie kรถnnen **FastAPI** instruieren, ihn als weiteren Body-Schlรผssel zu er
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="23" ```Python hl_lines="23"
{!> ../../../docs_src/body_multiple_params/tutorial003_an_py39.py!} {!> ../../docs_src/body_multiple_params/tutorial003_an_py39.py!}
``` ```
//// ////
@ -155,7 +155,7 @@ Aber Sie kรถnnen **FastAPI** instruieren, ihn als weiteren Body-Schlรผssel zu er
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="24" ```Python hl_lines="24"
{!> ../../../docs_src/body_multiple_params/tutorial003_an.py!} {!> ../../docs_src/body_multiple_params/tutorial003_an.py!}
``` ```
//// ////
@ -169,7 +169,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/body_multiple_params/tutorial003_py310.py!} {!> ../../docs_src/body_multiple_params/tutorial003_py310.py!}
``` ```
//// ////
@ -183,7 +183,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="22" ```Python hl_lines="22"
{!> ../../../docs_src/body_multiple_params/tutorial003.py!} {!> ../../docs_src/body_multiple_params/tutorial003.py!}
``` ```
//// ////
@ -229,7 +229,7 @@ Zum Beispiel:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="27" ```Python hl_lines="27"
{!> ../../../docs_src/body_multiple_params/tutorial004_an_py310.py!} {!> ../../docs_src/body_multiple_params/tutorial004_an_py310.py!}
``` ```
//// ////
@ -237,7 +237,7 @@ Zum Beispiel:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="27" ```Python hl_lines="27"
{!> ../../../docs_src/body_multiple_params/tutorial004_an_py39.py!} {!> ../../docs_src/body_multiple_params/tutorial004_an_py39.py!}
``` ```
//// ////
@ -245,7 +245,7 @@ Zum Beispiel:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="28" ```Python hl_lines="28"
{!> ../../../docs_src/body_multiple_params/tutorial004_an.py!} {!> ../../docs_src/body_multiple_params/tutorial004_an.py!}
``` ```
//// ////
@ -259,7 +259,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="25" ```Python hl_lines="25"
{!> ../../../docs_src/body_multiple_params/tutorial004_py310.py!} {!> ../../docs_src/body_multiple_params/tutorial004_py310.py!}
``` ```
//// ////
@ -273,7 +273,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="27" ```Python hl_lines="27"
{!> ../../../docs_src/body_multiple_params/tutorial004.py!} {!> ../../docs_src/body_multiple_params/tutorial004.py!}
``` ```
//// ////
@ -301,7 +301,7 @@ so wie in:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="17" ```Python hl_lines="17"
{!> ../../../docs_src/body_multiple_params/tutorial005_an_py310.py!} {!> ../../docs_src/body_multiple_params/tutorial005_an_py310.py!}
``` ```
//// ////
@ -309,7 +309,7 @@ so wie in:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="17" ```Python hl_lines="17"
{!> ../../../docs_src/body_multiple_params/tutorial005_an_py39.py!} {!> ../../docs_src/body_multiple_params/tutorial005_an_py39.py!}
``` ```
//// ////
@ -317,7 +317,7 @@ so wie in:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/body_multiple_params/tutorial005_an.py!} {!> ../../docs_src/body_multiple_params/tutorial005_an.py!}
``` ```
//// ////
@ -331,7 +331,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="15" ```Python hl_lines="15"
{!> ../../../docs_src/body_multiple_params/tutorial005_py310.py!} {!> ../../docs_src/body_multiple_params/tutorial005_py310.py!}
``` ```
//// ////
@ -345,7 +345,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="17" ```Python hl_lines="17"
{!> ../../../docs_src/body_multiple_params/tutorial005.py!} {!> ../../docs_src/body_multiple_params/tutorial005.py!}
``` ```
//// ////

56
docs/de/docs/tutorial/body-nested-models.md

@ -9,7 +9,7 @@ Sie kรถnnen ein Attribut als Kindtyp definieren, zum Beispiel eine Python-`list`
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/body_nested_models/tutorial001_py310.py!} {!> ../../docs_src/body_nested_models/tutorial001_py310.py!}
``` ```
//// ////
@ -17,7 +17,7 @@ Sie kรถnnen ein Attribut als Kindtyp definieren, zum Beispiel eine Python-`list`
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="14" ```Python hl_lines="14"
{!> ../../../docs_src/body_nested_models/tutorial001.py!} {!> ../../docs_src/body_nested_models/tutorial001.py!}
``` ```
//// ////
@ -35,7 +35,7 @@ In Python 3.9 oder darรผber kรถnnen Sie einfach `list` verwenden, um diese Typan
In Python-Versionen vor 3.9 (3.6 und darรผber), mรผssen Sie zuerst `List` von Pythons Standardmodul `typing` importieren. In Python-Versionen vor 3.9 (3.6 und darรผber), mรผssen Sie zuerst `List` von Pythons Standardmodul `typing` importieren.
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/body_nested_models/tutorial002.py!} {!> ../../docs_src/body_nested_models/tutorial002.py!}
``` ```
### Eine `list`e mit einem Typ-Parameter deklarieren ### Eine `list`e mit einem Typ-Parameter deklarieren
@ -68,7 +68,7 @@ In unserem Beispiel kรถnnen wir also bewirken, dass `tags` spezifisch eine โ€žLi
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/body_nested_models/tutorial002_py310.py!} {!> ../../docs_src/body_nested_models/tutorial002_py310.py!}
``` ```
//// ////
@ -76,7 +76,7 @@ In unserem Beispiel kรถnnen wir also bewirken, dass `tags` spezifisch eine โ€žLi
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="14" ```Python hl_lines="14"
{!> ../../../docs_src/body_nested_models/tutorial002_py39.py!} {!> ../../docs_src/body_nested_models/tutorial002_py39.py!}
``` ```
//// ////
@ -84,7 +84,7 @@ In unserem Beispiel kรถnnen wir also bewirken, dass `tags` spezifisch eine โ€žLi
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="14" ```Python hl_lines="14"
{!> ../../../docs_src/body_nested_models/tutorial002.py!} {!> ../../docs_src/body_nested_models/tutorial002.py!}
``` ```
//// ////
@ -100,7 +100,7 @@ Deklarieren wir also `tags` als Set von Strings.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/body_nested_models/tutorial003_py310.py!} {!> ../../docs_src/body_nested_models/tutorial003_py310.py!}
``` ```
//// ////
@ -108,7 +108,7 @@ Deklarieren wir also `tags` als Set von Strings.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="14" ```Python hl_lines="14"
{!> ../../../docs_src/body_nested_models/tutorial003_py39.py!} {!> ../../docs_src/body_nested_models/tutorial003_py39.py!}
``` ```
//// ////
@ -116,7 +116,7 @@ Deklarieren wir also `tags` als Set von Strings.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 14" ```Python hl_lines="1 14"
{!> ../../../docs_src/body_nested_models/tutorial003.py!} {!> ../../docs_src/body_nested_models/tutorial003.py!}
``` ```
//// ////
@ -144,7 +144,7 @@ Wir kรถnnen zum Beispiel ein `Image`-Modell definieren.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7-9" ```Python hl_lines="7-9"
{!> ../../../docs_src/body_nested_models/tutorial004_py310.py!} {!> ../../docs_src/body_nested_models/tutorial004_py310.py!}
``` ```
//// ////
@ -152,7 +152,7 @@ Wir kรถnnen zum Beispiel ein `Image`-Modell definieren.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9-11" ```Python hl_lines="9-11"
{!> ../../../docs_src/body_nested_models/tutorial004_py39.py!} {!> ../../docs_src/body_nested_models/tutorial004_py39.py!}
``` ```
//// ////
@ -160,7 +160,7 @@ Wir kรถnnen zum Beispiel ein `Image`-Modell definieren.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9-11" ```Python hl_lines="9-11"
{!> ../../../docs_src/body_nested_models/tutorial004.py!} {!> ../../docs_src/body_nested_models/tutorial004.py!}
``` ```
//// ////
@ -172,7 +172,7 @@ Und dann kรถnnen wir es als Typ eines Attributes verwenden.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/body_nested_models/tutorial004_py310.py!} {!> ../../docs_src/body_nested_models/tutorial004_py310.py!}
``` ```
//// ////
@ -180,7 +180,7 @@ Und dann kรถnnen wir es als Typ eines Attributes verwenden.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/body_nested_models/tutorial004_py39.py!} {!> ../../docs_src/body_nested_models/tutorial004_py39.py!}
``` ```
//// ////
@ -188,7 +188,7 @@ Und dann kรถnnen wir es als Typ eines Attributes verwenden.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/body_nested_models/tutorial004.py!} {!> ../../docs_src/body_nested_models/tutorial004.py!}
``` ```
//// ////
@ -227,7 +227,7 @@ Da wir zum Beispiel im `Image`-Modell ein Feld `url` haben, kรถnnen wir deklarie
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="2 8" ```Python hl_lines="2 8"
{!> ../../../docs_src/body_nested_models/tutorial005_py310.py!} {!> ../../docs_src/body_nested_models/tutorial005_py310.py!}
``` ```
//// ////
@ -235,7 +235,7 @@ Da wir zum Beispiel im `Image`-Modell ein Feld `url` haben, kรถnnen wir deklarie
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="4 10" ```Python hl_lines="4 10"
{!> ../../../docs_src/body_nested_models/tutorial005_py39.py!} {!> ../../docs_src/body_nested_models/tutorial005_py39.py!}
``` ```
//// ////
@ -243,7 +243,7 @@ Da wir zum Beispiel im `Image`-Modell ein Feld `url` haben, kรถnnen wir deklarie
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="4 10" ```Python hl_lines="4 10"
{!> ../../../docs_src/body_nested_models/tutorial005.py!} {!> ../../docs_src/body_nested_models/tutorial005.py!}
``` ```
//// ////
@ -257,7 +257,7 @@ Sie kรถnnen Pydantic-Modelle auch als Typen innerhalb von `list`, `set`, usw. ve
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/body_nested_models/tutorial006_py310.py!} {!> ../../docs_src/body_nested_models/tutorial006_py310.py!}
``` ```
//// ////
@ -265,7 +265,7 @@ Sie kรถnnen Pydantic-Modelle auch als Typen innerhalb von `list`, `set`, usw. ve
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/body_nested_models/tutorial006_py39.py!} {!> ../../docs_src/body_nested_models/tutorial006_py39.py!}
``` ```
//// ////
@ -273,7 +273,7 @@ Sie kรถnnen Pydantic-Modelle auch als Typen innerhalb von `list`, `set`, usw. ve
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/body_nested_models/tutorial006.py!} {!> ../../docs_src/body_nested_models/tutorial006.py!}
``` ```
//// ////
@ -317,7 +317,7 @@ Sie kรถnnen beliebig tief verschachtelte Modelle definieren:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7 12 18 21 25" ```Python hl_lines="7 12 18 21 25"
{!> ../../../docs_src/body_nested_models/tutorial007_py310.py!} {!> ../../docs_src/body_nested_models/tutorial007_py310.py!}
``` ```
//// ////
@ -325,7 +325,7 @@ Sie kรถnnen beliebig tief verschachtelte Modelle definieren:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9 14 20 23 27" ```Python hl_lines="9 14 20 23 27"
{!> ../../../docs_src/body_nested_models/tutorial007_py39.py!} {!> ../../docs_src/body_nested_models/tutorial007_py39.py!}
``` ```
//// ////
@ -333,7 +333,7 @@ Sie kรถnnen beliebig tief verschachtelte Modelle definieren:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9 14 20 23 27" ```Python hl_lines="9 14 20 23 27"
{!> ../../../docs_src/body_nested_models/tutorial007.py!} {!> ../../docs_src/body_nested_models/tutorial007.py!}
``` ```
//// ////
@ -363,7 +363,7 @@ so wie in:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="13" ```Python hl_lines="13"
{!> ../../../docs_src/body_nested_models/tutorial008_py39.py!} {!> ../../docs_src/body_nested_models/tutorial008_py39.py!}
``` ```
//// ////
@ -371,7 +371,7 @@ so wie in:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="15" ```Python hl_lines="15"
{!> ../../../docs_src/body_nested_models/tutorial008.py!} {!> ../../docs_src/body_nested_models/tutorial008.py!}
``` ```
//// ////
@ -407,7 +407,7 @@ Im folgenden Beispiel akzeptieren Sie irgendein `dict`, solange es `int`-Schlรผs
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/body_nested_models/tutorial009_py39.py!} {!> ../../docs_src/body_nested_models/tutorial009_py39.py!}
``` ```
//// ////
@ -415,7 +415,7 @@ Im folgenden Beispiel akzeptieren Sie irgendein `dict`, solange es `int`-Schlรผs
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/body_nested_models/tutorial009.py!} {!> ../../docs_src/body_nested_models/tutorial009.py!}
``` ```
//// ////

24
docs/de/docs/tutorial/body-updates.md

@ -9,7 +9,7 @@ Sie kรถnnen den `jsonable_encoder` verwenden, um die empfangenen Daten in etwas
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="28-33" ```Python hl_lines="28-33"
{!> ../../../docs_src/body_updates/tutorial001_py310.py!} {!> ../../docs_src/body_updates/tutorial001_py310.py!}
``` ```
//// ////
@ -17,7 +17,7 @@ Sie kรถnnen den `jsonable_encoder` verwenden, um die empfangenen Daten in etwas
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="30-35" ```Python hl_lines="30-35"
{!> ../../../docs_src/body_updates/tutorial001_py39.py!} {!> ../../docs_src/body_updates/tutorial001_py39.py!}
``` ```
//// ////
@ -25,7 +25,7 @@ Sie kรถnnen den `jsonable_encoder` verwenden, um die empfangenen Daten in etwas
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="30-35" ```Python hl_lines="30-35"
{!> ../../../docs_src/body_updates/tutorial001.py!} {!> ../../docs_src/body_updates/tutorial001.py!}
``` ```
//// ////
@ -87,7 +87,7 @@ Sie kรถnnen das verwenden, um ein `dict` zu erstellen, das nur die (im Request)
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="32" ```Python hl_lines="32"
{!> ../../../docs_src/body_updates/tutorial002_py310.py!} {!> ../../docs_src/body_updates/tutorial002_py310.py!}
``` ```
//// ////
@ -95,7 +95,7 @@ Sie kรถnnen das verwenden, um ein `dict` zu erstellen, das nur die (im Request)
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="34" ```Python hl_lines="34"
{!> ../../../docs_src/body_updates/tutorial002_py39.py!} {!> ../../docs_src/body_updates/tutorial002_py39.py!}
``` ```
//// ////
@ -103,7 +103,7 @@ Sie kรถnnen das verwenden, um ein `dict` zu erstellen, das nur die (im Request)
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="34" ```Python hl_lines="34"
{!> ../../../docs_src/body_updates/tutorial002.py!} {!> ../../docs_src/body_updates/tutorial002.py!}
``` ```
//// ////
@ -125,7 +125,7 @@ Wie in `stored_item_model.model_copy(update=update_data)`:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="33" ```Python hl_lines="33"
{!> ../../../docs_src/body_updates/tutorial002_py310.py!} {!> ../../docs_src/body_updates/tutorial002_py310.py!}
``` ```
//// ////
@ -133,7 +133,7 @@ Wie in `stored_item_model.model_copy(update=update_data)`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="35" ```Python hl_lines="35"
{!> ../../../docs_src/body_updates/tutorial002_py39.py!} {!> ../../docs_src/body_updates/tutorial002_py39.py!}
``` ```
//// ////
@ -141,7 +141,7 @@ Wie in `stored_item_model.model_copy(update=update_data)`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="35" ```Python hl_lines="35"
{!> ../../../docs_src/body_updates/tutorial002.py!} {!> ../../docs_src/body_updates/tutorial002.py!}
``` ```
//// ////
@ -164,7 +164,7 @@ Zusammengefasst, um Teil-Ersetzungen vorzunehmen:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="28-35" ```Python hl_lines="28-35"
{!> ../../../docs_src/body_updates/tutorial002_py310.py!} {!> ../../docs_src/body_updates/tutorial002_py310.py!}
``` ```
//// ////
@ -172,7 +172,7 @@ Zusammengefasst, um Teil-Ersetzungen vorzunehmen:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="30-37" ```Python hl_lines="30-37"
{!> ../../../docs_src/body_updates/tutorial002_py39.py!} {!> ../../docs_src/body_updates/tutorial002_py39.py!}
``` ```
//// ////
@ -180,7 +180,7 @@ Zusammengefasst, um Teil-Ersetzungen vorzunehmen:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="30-37" ```Python hl_lines="30-37"
{!> ../../../docs_src/body_updates/tutorial002.py!} {!> ../../docs_src/body_updates/tutorial002.py!}
``` ```
//// ////

24
docs/de/docs/tutorial/body.md

@ -25,7 +25,7 @@ Zuerst mรผssen Sie `BaseModel` von `pydantic` importieren:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="2" ```Python hl_lines="2"
{!> ../../../docs_src/body/tutorial001_py310.py!} {!> ../../docs_src/body/tutorial001_py310.py!}
``` ```
//// ////
@ -33,7 +33,7 @@ Zuerst mรผssen Sie `BaseModel` von `pydantic` importieren:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="4" ```Python hl_lines="4"
{!> ../../../docs_src/body/tutorial001.py!} {!> ../../docs_src/body/tutorial001.py!}
``` ```
//// ////
@ -47,7 +47,7 @@ Verwenden Sie Standard-Python-Typen fรผr die Klassenattribute:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="5-9" ```Python hl_lines="5-9"
{!> ../../../docs_src/body/tutorial001_py310.py!} {!> ../../docs_src/body/tutorial001_py310.py!}
``` ```
//// ////
@ -55,7 +55,7 @@ Verwenden Sie Standard-Python-Typen fรผr die Klassenattribute:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="7-11" ```Python hl_lines="7-11"
{!> ../../../docs_src/body/tutorial001.py!} {!> ../../docs_src/body/tutorial001.py!}
``` ```
//// ////
@ -89,7 +89,7 @@ Um es zu Ihrer *Pfadoperation* hinzuzufรผgen, deklarieren Sie es auf die gleiche
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="16" ```Python hl_lines="16"
{!> ../../../docs_src/body/tutorial001_py310.py!} {!> ../../docs_src/body/tutorial001_py310.py!}
``` ```
//// ////
@ -97,7 +97,7 @@ Um es zu Ihrer *Pfadoperation* hinzuzufรผgen, deklarieren Sie es auf die gleiche
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/body/tutorial001.py!} {!> ../../docs_src/body/tutorial001.py!}
``` ```
//// ////
@ -170,7 +170,7 @@ Innerhalb der Funktion kรถnnen Sie alle Attribute des Modells direkt verwenden:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/body/tutorial002_py310.py!} {!> ../../docs_src/body/tutorial002_py310.py!}
``` ```
//// ////
@ -178,7 +178,7 @@ Innerhalb der Funktion kรถnnen Sie alle Attribute des Modells direkt verwenden:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="21" ```Python hl_lines="21"
{!> ../../../docs_src/body/tutorial002.py!} {!> ../../docs_src/body/tutorial002.py!}
``` ```
//// ////
@ -192,7 +192,7 @@ Sie kรถnnen Pfad- und Requestbody-Parameter gleichzeitig deklarieren.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="15-16" ```Python hl_lines="15-16"
{!> ../../../docs_src/body/tutorial003_py310.py!} {!> ../../docs_src/body/tutorial003_py310.py!}
``` ```
//// ////
@ -200,7 +200,7 @@ Sie kรถnnen Pfad- und Requestbody-Parameter gleichzeitig deklarieren.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="17-18" ```Python hl_lines="17-18"
{!> ../../../docs_src/body/tutorial003.py!} {!> ../../docs_src/body/tutorial003.py!}
``` ```
//// ////
@ -214,7 +214,7 @@ Sie kรถnnen auch zur gleichen Zeit **Body-**, **Pfad-** und **Query-Parameter**
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="16" ```Python hl_lines="16"
{!> ../../../docs_src/body/tutorial004_py310.py!} {!> ../../docs_src/body/tutorial004_py310.py!}
``` ```
//// ////
@ -222,7 +222,7 @@ Sie kรถnnen auch zur gleichen Zeit **Body-**, **Pfad-** und **Query-Parameter**
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/body/tutorial004.py!} {!> ../../docs_src/body/tutorial004.py!}
``` ```
//// ////

20
docs/de/docs/tutorial/cookie-params.md

@ -9,7 +9,7 @@ Importieren Sie zuerst `Cookie`:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!} {!> ../../docs_src/cookie_params/tutorial001_an_py310.py!}
``` ```
//// ////
@ -17,7 +17,7 @@ Importieren Sie zuerst `Cookie`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!} {!> ../../docs_src/cookie_params/tutorial001_an_py39.py!}
``` ```
//// ////
@ -25,7 +25,7 @@ Importieren Sie zuerst `Cookie`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/cookie_params/tutorial001_an.py!} {!> ../../docs_src/cookie_params/tutorial001_an.py!}
``` ```
//// ////
@ -39,7 +39,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/cookie_params/tutorial001_py310.py!} {!> ../../docs_src/cookie_params/tutorial001_py310.py!}
``` ```
//// ////
@ -53,7 +53,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/cookie_params/tutorial001.py!} {!> ../../docs_src/cookie_params/tutorial001.py!}
``` ```
//// ////
@ -67,7 +67,7 @@ Der erste Wert ist der Typ. Sie kรถnnen `Cookie` die gehabten Extra Validierungs
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/cookie_params/tutorial001_an_py310.py!} {!> ../../docs_src/cookie_params/tutorial001_an_py310.py!}
``` ```
//// ////
@ -75,7 +75,7 @@ Der erste Wert ist der Typ. Sie kรถnnen `Cookie` die gehabten Extra Validierungs
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/cookie_params/tutorial001_an_py39.py!} {!> ../../docs_src/cookie_params/tutorial001_an_py39.py!}
``` ```
//// ////
@ -83,7 +83,7 @@ Der erste Wert ist der Typ. Sie kรถnnen `Cookie` die gehabten Extra Validierungs
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/cookie_params/tutorial001_an.py!} {!> ../../docs_src/cookie_params/tutorial001_an.py!}
``` ```
//// ////
@ -97,7 +97,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/cookie_params/tutorial001_py310.py!} {!> ../../docs_src/cookie_params/tutorial001_py310.py!}
``` ```
//// ////
@ -111,7 +111,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/cookie_params/tutorial001.py!} {!> ../../docs_src/cookie_params/tutorial001.py!}
``` ```
//// ////

70
docs/de/docs/tutorial/dependencies/classes-as-dependencies.md

@ -9,7 +9,7 @@ Im vorherigen Beispiel haben wir ein `dict` von unserer Abhรคngigkeit (โ€žDepend
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/dependencies/tutorial001_an_py310.py!} {!> ../../docs_src/dependencies/tutorial001_an_py310.py!}
``` ```
//// ////
@ -17,7 +17,7 @@ Im vorherigen Beispiel haben wir ein `dict` von unserer Abhรคngigkeit (โ€žDepend
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/dependencies/tutorial001_an_py39.py!} {!> ../../docs_src/dependencies/tutorial001_an_py39.py!}
``` ```
//// ////
@ -25,7 +25,7 @@ Im vorherigen Beispiel haben wir ein `dict` von unserer Abhรคngigkeit (โ€žDepend
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/dependencies/tutorial001_an.py!} {!> ../../docs_src/dependencies/tutorial001_an.py!}
``` ```
//// ////
@ -39,7 +39,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/dependencies/tutorial001_py310.py!} {!> ../../docs_src/dependencies/tutorial001_py310.py!}
``` ```
//// ////
@ -53,7 +53,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/dependencies/tutorial001.py!} {!> ../../docs_src/dependencies/tutorial001.py!}
``` ```
//// ////
@ -122,7 +122,7 @@ Dann kรถnnen wir das โ€žDependableโ€œ `common_parameters` der Abhรคngigkeit von
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="11-15" ```Python hl_lines="11-15"
{!> ../../../docs_src/dependencies/tutorial002_an_py310.py!} {!> ../../docs_src/dependencies/tutorial002_an_py310.py!}
``` ```
//// ////
@ -130,7 +130,7 @@ Dann kรถnnen wir das โ€žDependableโ€œ `common_parameters` der Abhรคngigkeit von
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="11-15" ```Python hl_lines="11-15"
{!> ../../../docs_src/dependencies/tutorial002_an_py39.py!} {!> ../../docs_src/dependencies/tutorial002_an_py39.py!}
``` ```
//// ////
@ -138,7 +138,7 @@ Dann kรถnnen wir das โ€žDependableโ€œ `common_parameters` der Abhรคngigkeit von
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="12-16" ```Python hl_lines="12-16"
{!> ../../../docs_src/dependencies/tutorial002_an.py!} {!> ../../docs_src/dependencies/tutorial002_an.py!}
``` ```
//// ////
@ -152,7 +152,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9-13" ```Python hl_lines="9-13"
{!> ../../../docs_src/dependencies/tutorial002_py310.py!} {!> ../../docs_src/dependencies/tutorial002_py310.py!}
``` ```
//// ////
@ -166,7 +166,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11-15" ```Python hl_lines="11-15"
{!> ../../../docs_src/dependencies/tutorial002.py!} {!> ../../docs_src/dependencies/tutorial002.py!}
``` ```
//// ////
@ -176,7 +176,7 @@ Achten Sie auf die Methode `__init__`, die zum Erstellen der Instanz der Klasse
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/dependencies/tutorial002_an_py310.py!} {!> ../../docs_src/dependencies/tutorial002_an_py310.py!}
``` ```
//// ////
@ -184,7 +184,7 @@ Achten Sie auf die Methode `__init__`, die zum Erstellen der Instanz der Klasse
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/dependencies/tutorial002_an_py39.py!} {!> ../../docs_src/dependencies/tutorial002_an_py39.py!}
``` ```
//// ////
@ -192,7 +192,7 @@ Achten Sie auf die Methode `__init__`, die zum Erstellen der Instanz der Klasse
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="13" ```Python hl_lines="13"
{!> ../../../docs_src/dependencies/tutorial002_an.py!} {!> ../../docs_src/dependencies/tutorial002_an.py!}
``` ```
//// ////
@ -206,7 +206,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/dependencies/tutorial002_py310.py!} {!> ../../docs_src/dependencies/tutorial002_py310.py!}
``` ```
//// ////
@ -220,7 +220,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/dependencies/tutorial002.py!} {!> ../../docs_src/dependencies/tutorial002.py!}
``` ```
//// ////
@ -230,7 +230,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/dependencies/tutorial001_an_py310.py!} {!> ../../docs_src/dependencies/tutorial001_an_py310.py!}
``` ```
//// ////
@ -238,7 +238,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/dependencies/tutorial001_an_py39.py!} {!> ../../docs_src/dependencies/tutorial001_an_py39.py!}
``` ```
//// ////
@ -246,7 +246,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/dependencies/tutorial001_an.py!} {!> ../../docs_src/dependencies/tutorial001_an.py!}
``` ```
//// ////
@ -260,7 +260,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="6" ```Python hl_lines="6"
{!> ../../../docs_src/dependencies/tutorial001_py310.py!} {!> ../../docs_src/dependencies/tutorial001_py310.py!}
``` ```
//// ////
@ -274,7 +274,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/dependencies/tutorial001.py!} {!> ../../docs_src/dependencies/tutorial001.py!}
``` ```
//// ////
@ -296,7 +296,7 @@ Jetzt kรถnnen Sie Ihre Abhรคngigkeit mithilfe dieser Klasse deklarieren.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial002_an_py310.py!} {!> ../../docs_src/dependencies/tutorial002_an_py310.py!}
``` ```
//// ////
@ -304,7 +304,7 @@ Jetzt kรถnnen Sie Ihre Abhรคngigkeit mithilfe dieser Klasse deklarieren.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial002_an_py39.py!} {!> ../../docs_src/dependencies/tutorial002_an_py39.py!}
``` ```
//// ////
@ -312,7 +312,7 @@ Jetzt kรถnnen Sie Ihre Abhรคngigkeit mithilfe dieser Klasse deklarieren.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/dependencies/tutorial002_an.py!} {!> ../../docs_src/dependencies/tutorial002_an.py!}
``` ```
//// ////
@ -326,7 +326,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="17" ```Python hl_lines="17"
{!> ../../../docs_src/dependencies/tutorial002_py310.py!} {!> ../../docs_src/dependencies/tutorial002_py310.py!}
``` ```
//// ////
@ -340,7 +340,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial002.py!} {!> ../../docs_src/dependencies/tutorial002.py!}
``` ```
//// ////
@ -440,7 +440,7 @@ commons = Depends(CommonQueryParams)
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial003_an_py310.py!} {!> ../../docs_src/dependencies/tutorial003_an_py310.py!}
``` ```
//// ////
@ -448,7 +448,7 @@ commons = Depends(CommonQueryParams)
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial003_an_py39.py!} {!> ../../docs_src/dependencies/tutorial003_an_py39.py!}
``` ```
//// ////
@ -456,7 +456,7 @@ commons = Depends(CommonQueryParams)
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/dependencies/tutorial003_an.py!} {!> ../../docs_src/dependencies/tutorial003_an.py!}
``` ```
//// ////
@ -470,7 +470,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="17" ```Python hl_lines="17"
{!> ../../../docs_src/dependencies/tutorial003_py310.py!} {!> ../../docs_src/dependencies/tutorial003_py310.py!}
``` ```
//// ////
@ -484,7 +484,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial003.py!} {!> ../../docs_src/dependencies/tutorial003.py!}
``` ```
//// ////
@ -578,7 +578,7 @@ Dasselbe Beispiel wรผrde dann so aussehen:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial004_an_py310.py!} {!> ../../docs_src/dependencies/tutorial004_an_py310.py!}
``` ```
//// ////
@ -586,7 +586,7 @@ Dasselbe Beispiel wรผrde dann so aussehen:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial004_an_py39.py!} {!> ../../docs_src/dependencies/tutorial004_an_py39.py!}
``` ```
//// ////
@ -594,7 +594,7 @@ Dasselbe Beispiel wรผrde dann so aussehen:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/dependencies/tutorial004_an.py!} {!> ../../docs_src/dependencies/tutorial004_an.py!}
``` ```
//// ////
@ -608,7 +608,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="17" ```Python hl_lines="17"
{!> ../../../docs_src/dependencies/tutorial004_py310.py!} {!> ../../docs_src/dependencies/tutorial004_py310.py!}
``` ```
//// ////
@ -622,7 +622,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial004.py!} {!> ../../docs_src/dependencies/tutorial004.py!}
``` ```
//// ////

24
docs/de/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md

@ -17,7 +17,7 @@ Es sollte eine `list`e von `Depends()` sein:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial006_an_py39.py!} {!> ../../docs_src/dependencies/tutorial006_an_py39.py!}
``` ```
//// ////
@ -25,7 +25,7 @@ Es sollte eine `list`e von `Depends()` sein:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/dependencies/tutorial006_an.py!} {!> ../../docs_src/dependencies/tutorial006_an.py!}
``` ```
//// ////
@ -39,7 +39,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="17" ```Python hl_lines="17"
{!> ../../../docs_src/dependencies/tutorial006.py!} {!> ../../docs_src/dependencies/tutorial006.py!}
``` ```
//// ////
@ -75,7 +75,7 @@ Sie kรถnnen Anforderungen fรผr einen Request (wie Header) oder andere Unterabhรค
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="8 13" ```Python hl_lines="8 13"
{!> ../../../docs_src/dependencies/tutorial006_an_py39.py!} {!> ../../docs_src/dependencies/tutorial006_an_py39.py!}
``` ```
//// ////
@ -83,7 +83,7 @@ Sie kรถnnen Anforderungen fรผr einen Request (wie Header) oder andere Unterabhรค
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="7 12" ```Python hl_lines="7 12"
{!> ../../../docs_src/dependencies/tutorial006_an.py!} {!> ../../docs_src/dependencies/tutorial006_an.py!}
``` ```
//// ////
@ -97,7 +97,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="6 11" ```Python hl_lines="6 11"
{!> ../../../docs_src/dependencies/tutorial006.py!} {!> ../../docs_src/dependencies/tutorial006.py!}
``` ```
//// ////
@ -109,7 +109,7 @@ Die Abhรคngigkeiten kรถnnen Exceptions `raise`n, genau wie normale Abhรคngigkeit
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10 15" ```Python hl_lines="10 15"
{!> ../../../docs_src/dependencies/tutorial006_an_py39.py!} {!> ../../docs_src/dependencies/tutorial006_an_py39.py!}
``` ```
//// ////
@ -117,7 +117,7 @@ Die Abhรคngigkeiten kรถnnen Exceptions `raise`n, genau wie normale Abhรคngigkeit
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9 14" ```Python hl_lines="9 14"
{!> ../../../docs_src/dependencies/tutorial006_an.py!} {!> ../../docs_src/dependencies/tutorial006_an.py!}
``` ```
//// ////
@ -131,7 +131,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8 13" ```Python hl_lines="8 13"
{!> ../../../docs_src/dependencies/tutorial006.py!} {!> ../../docs_src/dependencies/tutorial006.py!}
``` ```
//// ////
@ -145,7 +145,7 @@ Sie kรถnnen also eine normale Abhรคngigkeit (die einen Wert zurรผckgibt), die Si
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="11 16" ```Python hl_lines="11 16"
{!> ../../../docs_src/dependencies/tutorial006_an_py39.py!} {!> ../../docs_src/dependencies/tutorial006_an_py39.py!}
``` ```
//// ////
@ -153,7 +153,7 @@ Sie kรถnnen also eine normale Abhรคngigkeit (die einen Wert zurรผckgibt), die Si
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10 15" ```Python hl_lines="10 15"
{!> ../../../docs_src/dependencies/tutorial006_an.py!} {!> ../../docs_src/dependencies/tutorial006_an.py!}
``` ```
//// ////
@ -167,7 +167,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9 14" ```Python hl_lines="9 14"
{!> ../../../docs_src/dependencies/tutorial006.py!} {!> ../../docs_src/dependencies/tutorial006.py!}
``` ```
//// ////

28
docs/de/docs/tutorial/dependencies/dependencies-with-yield.md

@ -30,19 +30,19 @@ Sie kรถnnten damit beispielsweise eine Datenbanksession erstellen und diese nach
Nur der Code vor und einschlieรŸlich der `yield`-Anweisung wird ausgefรผhrt, bevor eine Response erzeugt wird: Nur der Code vor und einschlieรŸlich der `yield`-Anweisung wird ausgefรผhrt, bevor eine Response erzeugt wird:
```Python hl_lines="2-4" ```Python hl_lines="2-4"
{!../../../docs_src/dependencies/tutorial007.py!} {!../../docs_src/dependencies/tutorial007.py!}
``` ```
Der ge`yield`ete Wert ist das, was in *Pfadoperationen* und andere Abhรคngigkeiten eingefรผgt wird: Der ge`yield`ete Wert ist das, was in *Pfadoperationen* und andere Abhรคngigkeiten eingefรผgt wird:
```Python hl_lines="4" ```Python hl_lines="4"
{!../../../docs_src/dependencies/tutorial007.py!} {!../../docs_src/dependencies/tutorial007.py!}
``` ```
Der auf die `yield`-Anweisung folgende Code wird ausgefรผhrt, nachdem die Response gesendet wurde: Der auf die `yield`-Anweisung folgende Code wird ausgefรผhrt, nachdem die Response gesendet wurde:
```Python hl_lines="5-6" ```Python hl_lines="5-6"
{!../../../docs_src/dependencies/tutorial007.py!} {!../../docs_src/dependencies/tutorial007.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -64,7 +64,7 @@ Sie kรถnnen also mit `except SomeException` diese bestimmte Exception innerhalb
Auf die gleiche Weise kรถnnen Sie `finally` verwenden, um sicherzustellen, dass die Exit-Schritte ausgefรผhrt werden, unabhรคngig davon, ob eine Exception geworfen wurde oder nicht. Auf die gleiche Weise kรถnnen Sie `finally` verwenden, um sicherzustellen, dass die Exit-Schritte ausgefรผhrt werden, unabhรคngig davon, ob eine Exception geworfen wurde oder nicht.
```Python hl_lines="3 5" ```Python hl_lines="3 5"
{!../../../docs_src/dependencies/tutorial007.py!} {!../../docs_src/dependencies/tutorial007.py!}
``` ```
## Unterabhรคngigkeiten mit `yield`. ## Unterabhรคngigkeiten mit `yield`.
@ -78,7 +78,7 @@ Beispielsweise kann `dependency_c` von `dependency_b` und `dependency_b` von `de
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="6 14 22" ```Python hl_lines="6 14 22"
{!> ../../../docs_src/dependencies/tutorial008_an_py39.py!} {!> ../../docs_src/dependencies/tutorial008_an_py39.py!}
``` ```
//// ////
@ -86,7 +86,7 @@ Beispielsweise kann `dependency_c` von `dependency_b` und `dependency_b` von `de
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="5 13 21" ```Python hl_lines="5 13 21"
{!> ../../../docs_src/dependencies/tutorial008_an.py!} {!> ../../docs_src/dependencies/tutorial008_an.py!}
``` ```
//// ////
@ -100,7 +100,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="4 12 20" ```Python hl_lines="4 12 20"
{!> ../../../docs_src/dependencies/tutorial008.py!} {!> ../../docs_src/dependencies/tutorial008.py!}
``` ```
//// ////
@ -114,7 +114,7 @@ Und wiederum benรถtigt `dependency_b` den Wert von `dependency_a` (hier `dep_a`
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="18-19 26-27" ```Python hl_lines="18-19 26-27"
{!> ../../../docs_src/dependencies/tutorial008_an_py39.py!} {!> ../../docs_src/dependencies/tutorial008_an_py39.py!}
``` ```
//// ////
@ -122,7 +122,7 @@ Und wiederum benรถtigt `dependency_b` den Wert von `dependency_a` (hier `dep_a`
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="17-18 25-26" ```Python hl_lines="17-18 25-26"
{!> ../../../docs_src/dependencies/tutorial008_an.py!} {!> ../../docs_src/dependencies/tutorial008_an.py!}
``` ```
//// ////
@ -136,7 +136,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="16-17 24-25" ```Python hl_lines="16-17 24-25"
{!> ../../../docs_src/dependencies/tutorial008.py!} {!> ../../docs_src/dependencies/tutorial008.py!}
``` ```
//// ////
@ -174,7 +174,7 @@ Aber es ist fรผr Sie da, wenn Sie es brauchen. ๐Ÿค“
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="18-22 31" ```Python hl_lines="18-22 31"
{!> ../../../docs_src/dependencies/tutorial008b_an_py39.py!} {!> ../../docs_src/dependencies/tutorial008b_an_py39.py!}
``` ```
//// ////
@ -182,7 +182,7 @@ Aber es ist fรผr Sie da, wenn Sie es brauchen. ๐Ÿค“
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="17-21 30" ```Python hl_lines="17-21 30"
{!> ../../../docs_src/dependencies/tutorial008b_an.py!} {!> ../../docs_src/dependencies/tutorial008b_an.py!}
``` ```
//// ////
@ -196,7 +196,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="16-20 29" ```Python hl_lines="16-20 29"
{!> ../../../docs_src/dependencies/tutorial008b.py!} {!> ../../docs_src/dependencies/tutorial008b.py!}
``` ```
//// ////
@ -321,7 +321,7 @@ In Python kรถnnen Sie Kontextmanager erstellen, indem Sie <a href="https://docs.
Sie kรถnnen solche auch innerhalb von **FastAPI**-Abhรคngigkeiten mit `yield` verwenden, indem Sie `with`- oder `async with`-Anweisungen innerhalb der Abhรคngigkeits-Funktion verwenden: Sie kรถnnen solche auch innerhalb von **FastAPI**-Abhรคngigkeiten mit `yield` verwenden, indem Sie `with`- oder `async with`-Anweisungen innerhalb der Abhรคngigkeits-Funktion verwenden:
```Python hl_lines="1-9 13" ```Python hl_lines="1-9 13"
{!../../../docs_src/dependencies/tutorial010.py!} {!../../docs_src/dependencies/tutorial010.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"

6
docs/de/docs/tutorial/dependencies/global-dependencies.md

@ -9,7 +9,7 @@ In diesem Fall werden sie auf alle *Pfadoperationen* in der Anwendung angewendet
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="16" ```Python hl_lines="16"
{!> ../../../docs_src/dependencies/tutorial012_an_py39.py!} {!> ../../docs_src/dependencies/tutorial012_an_py39.py!}
``` ```
//// ////
@ -17,7 +17,7 @@ In diesem Fall werden sie auf alle *Pfadoperationen* in der Anwendung angewendet
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="16" ```Python hl_lines="16"
{!> ../../../docs_src/dependencies/tutorial012_an.py!} {!> ../../docs_src/dependencies/tutorial012_an.py!}
``` ```
//// ////
@ -31,7 +31,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="15" ```Python hl_lines="15"
{!> ../../../docs_src/dependencies/tutorial012.py!} {!> ../../docs_src/dependencies/tutorial012.py!}
``` ```
//// ////

36
docs/de/docs/tutorial/dependencies/index.md

@ -33,7 +33,7 @@ Es handelt sich einfach um eine Funktion, die die gleichen Parameter entgegennim
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="8-9" ```Python hl_lines="8-9"
{!> ../../../docs_src/dependencies/tutorial001_an_py310.py!} {!> ../../docs_src/dependencies/tutorial001_an_py310.py!}
``` ```
//// ////
@ -41,7 +41,7 @@ Es handelt sich einfach um eine Funktion, die die gleichen Parameter entgegennim
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="8-11" ```Python hl_lines="8-11"
{!> ../../../docs_src/dependencies/tutorial001_an_py39.py!} {!> ../../docs_src/dependencies/tutorial001_an_py39.py!}
``` ```
//// ////
@ -49,7 +49,7 @@ Es handelt sich einfach um eine Funktion, die die gleichen Parameter entgegennim
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9-12" ```Python hl_lines="9-12"
{!> ../../../docs_src/dependencies/tutorial001_an.py!} {!> ../../docs_src/dependencies/tutorial001_an.py!}
``` ```
//// ////
@ -63,7 +63,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="6-7" ```Python hl_lines="6-7"
{!> ../../../docs_src/dependencies/tutorial001_py310.py!} {!> ../../docs_src/dependencies/tutorial001_py310.py!}
``` ```
//// ////
@ -77,7 +77,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8-11" ```Python hl_lines="8-11"
{!> ../../../docs_src/dependencies/tutorial001.py!} {!> ../../docs_src/dependencies/tutorial001.py!}
``` ```
//// ////
@ -115,7 +115,7 @@ Bitte [aktualisieren Sie FastAPI](../../deployment/versions.md#upgrade-der-fasta
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/dependencies/tutorial001_an_py310.py!} {!> ../../docs_src/dependencies/tutorial001_an_py310.py!}
``` ```
//// ////
@ -123,7 +123,7 @@ Bitte [aktualisieren Sie FastAPI](../../deployment/versions.md#upgrade-der-fasta
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/dependencies/tutorial001_an_py39.py!} {!> ../../docs_src/dependencies/tutorial001_an_py39.py!}
``` ```
//// ////
@ -131,7 +131,7 @@ Bitte [aktualisieren Sie FastAPI](../../deployment/versions.md#upgrade-der-fasta
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/dependencies/tutorial001_an.py!} {!> ../../docs_src/dependencies/tutorial001_an.py!}
``` ```
//// ////
@ -145,7 +145,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/dependencies/tutorial001_py310.py!} {!> ../../docs_src/dependencies/tutorial001_py310.py!}
``` ```
//// ////
@ -159,7 +159,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/dependencies/tutorial001.py!} {!> ../../docs_src/dependencies/tutorial001.py!}
``` ```
//// ////
@ -171,7 +171,7 @@ So wie auch `Body`, `Query`, usw., verwenden Sie `Depends` mit den Parametern Ih
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="13 18" ```Python hl_lines="13 18"
{!> ../../../docs_src/dependencies/tutorial001_an_py310.py!} {!> ../../docs_src/dependencies/tutorial001_an_py310.py!}
``` ```
//// ////
@ -179,7 +179,7 @@ So wie auch `Body`, `Query`, usw., verwenden Sie `Depends` mit den Parametern Ih
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="15 20" ```Python hl_lines="15 20"
{!> ../../../docs_src/dependencies/tutorial001_an_py39.py!} {!> ../../docs_src/dependencies/tutorial001_an_py39.py!}
``` ```
//// ////
@ -187,7 +187,7 @@ So wie auch `Body`, `Query`, usw., verwenden Sie `Depends` mit den Parametern Ih
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="16 21" ```Python hl_lines="16 21"
{!> ../../../docs_src/dependencies/tutorial001_an.py!} {!> ../../docs_src/dependencies/tutorial001_an.py!}
``` ```
//// ////
@ -201,7 +201,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11 16" ```Python hl_lines="11 16"
{!> ../../../docs_src/dependencies/tutorial001_py310.py!} {!> ../../docs_src/dependencies/tutorial001_py310.py!}
``` ```
//// ////
@ -215,7 +215,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="15 20" ```Python hl_lines="15 20"
{!> ../../../docs_src/dependencies/tutorial001.py!} {!> ../../docs_src/dependencies/tutorial001.py!}
``` ```
//// ////
@ -278,7 +278,7 @@ Da wir jedoch `Annotated` verwenden, kรถnnen wir diesen `Annotated`-Wert in eine
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="12 16 21" ```Python hl_lines="12 16 21"
{!> ../../../docs_src/dependencies/tutorial001_02_an_py310.py!} {!> ../../docs_src/dependencies/tutorial001_02_an_py310.py!}
``` ```
//// ////
@ -286,7 +286,7 @@ Da wir jedoch `Annotated` verwenden, kรถnnen wir diesen `Annotated`-Wert in eine
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="14 18 23" ```Python hl_lines="14 18 23"
{!> ../../../docs_src/dependencies/tutorial001_02_an_py39.py!} {!> ../../docs_src/dependencies/tutorial001_02_an_py39.py!}
``` ```
//// ////
@ -294,7 +294,7 @@ Da wir jedoch `Annotated` verwenden, kรถnnen wir diesen `Annotated`-Wert in eine
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="15 19 24" ```Python hl_lines="15 19 24"
{!> ../../../docs_src/dependencies/tutorial001_02_an.py!} {!> ../../docs_src/dependencies/tutorial001_02_an.py!}
``` ```
//// ////

30
docs/de/docs/tutorial/dependencies/sub-dependencies.md

@ -13,7 +13,7 @@ Sie kรถnnten eine erste Abhรคngigkeit (โ€žDependableโ€œ) wie folgt erstellen:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="8-9" ```Python hl_lines="8-9"
{!> ../../../docs_src/dependencies/tutorial005_an_py310.py!} {!> ../../docs_src/dependencies/tutorial005_an_py310.py!}
``` ```
//// ////
@ -21,7 +21,7 @@ Sie kรถnnten eine erste Abhรคngigkeit (โ€žDependableโ€œ) wie folgt erstellen:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="8-9" ```Python hl_lines="8-9"
{!> ../../../docs_src/dependencies/tutorial005_an_py39.py!} {!> ../../docs_src/dependencies/tutorial005_an_py39.py!}
``` ```
//// ////
@ -29,7 +29,7 @@ Sie kรถnnten eine erste Abhรคngigkeit (โ€žDependableโ€œ) wie folgt erstellen:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9-10" ```Python hl_lines="9-10"
{!> ../../../docs_src/dependencies/tutorial005_an.py!} {!> ../../docs_src/dependencies/tutorial005_an.py!}
``` ```
//// ////
@ -43,7 +43,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="6-7" ```Python hl_lines="6-7"
{!> ../../../docs_src/dependencies/tutorial005_py310.py!} {!> ../../docs_src/dependencies/tutorial005_py310.py!}
``` ```
//// ////
@ -57,7 +57,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8-9" ```Python hl_lines="8-9"
{!> ../../../docs_src/dependencies/tutorial005.py!} {!> ../../docs_src/dependencies/tutorial005.py!}
``` ```
//// ////
@ -73,7 +73,7 @@ Dann kรถnnen Sie eine weitere Abhรคngigkeitsfunktion (ein โ€žDependableโ€œ) erst
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="13" ```Python hl_lines="13"
{!> ../../../docs_src/dependencies/tutorial005_an_py310.py!} {!> ../../docs_src/dependencies/tutorial005_an_py310.py!}
``` ```
//// ////
@ -81,7 +81,7 @@ Dann kรถnnen Sie eine weitere Abhรคngigkeitsfunktion (ein โ€žDependableโ€œ) erst
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="13" ```Python hl_lines="13"
{!> ../../../docs_src/dependencies/tutorial005_an_py39.py!} {!> ../../docs_src/dependencies/tutorial005_an_py39.py!}
``` ```
//// ////
@ -89,7 +89,7 @@ Dann kรถnnen Sie eine weitere Abhรคngigkeitsfunktion (ein โ€žDependableโ€œ) erst
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="14" ```Python hl_lines="14"
{!> ../../../docs_src/dependencies/tutorial005_an.py!} {!> ../../docs_src/dependencies/tutorial005_an.py!}
``` ```
//// ////
@ -103,7 +103,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/dependencies/tutorial005_py310.py!} {!> ../../docs_src/dependencies/tutorial005_py310.py!}
``` ```
//// ////
@ -117,7 +117,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="13" ```Python hl_lines="13"
{!> ../../../docs_src/dependencies/tutorial005.py!} {!> ../../docs_src/dependencies/tutorial005.py!}
``` ```
//// ////
@ -136,7 +136,7 @@ Diese Abhรคngigkeit verwenden wir nun wie folgt:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="23" ```Python hl_lines="23"
{!> ../../../docs_src/dependencies/tutorial005_an_py310.py!} {!> ../../docs_src/dependencies/tutorial005_an_py310.py!}
``` ```
//// ////
@ -144,7 +144,7 @@ Diese Abhรคngigkeit verwenden wir nun wie folgt:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="23" ```Python hl_lines="23"
{!> ../../../docs_src/dependencies/tutorial005_an_py39.py!} {!> ../../docs_src/dependencies/tutorial005_an_py39.py!}
``` ```
//// ////
@ -152,7 +152,7 @@ Diese Abhรคngigkeit verwenden wir nun wie folgt:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="24" ```Python hl_lines="24"
{!> ../../../docs_src/dependencies/tutorial005_an.py!} {!> ../../docs_src/dependencies/tutorial005_an.py!}
``` ```
//// ////
@ -166,7 +166,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/dependencies/tutorial005_py310.py!} {!> ../../docs_src/dependencies/tutorial005_py310.py!}
``` ```
//// ////
@ -180,7 +180,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="22" ```Python hl_lines="22"
{!> ../../../docs_src/dependencies/tutorial005.py!} {!> ../../docs_src/dependencies/tutorial005.py!}
``` ```
//// ////

4
docs/de/docs/tutorial/encoder.md

@ -23,7 +23,7 @@ Es nimmt ein Objekt entgegen, wie etwa ein Pydantic-Modell, und gibt eine JSON-k
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="4 21" ```Python hl_lines="4 21"
{!> ../../../docs_src/encoder/tutorial001_py310.py!} {!> ../../docs_src/encoder/tutorial001_py310.py!}
``` ```
//// ////
@ -31,7 +31,7 @@ Es nimmt ein Objekt entgegen, wie etwa ein Pydantic-Modell, und gibt eine JSON-k
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="5 22" ```Python hl_lines="5 22"
{!> ../../../docs_src/encoder/tutorial001.py!} {!> ../../docs_src/encoder/tutorial001.py!}
``` ```
//// ////

20
docs/de/docs/tutorial/extra-data-types.md

@ -58,7 +58,7 @@ Hier ist ein Beispiel fรผr eine *Pfadoperation* mit Parametern, die einige der o
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="1 3 12-16" ```Python hl_lines="1 3 12-16"
{!> ../../../docs_src/extra_data_types/tutorial001_an_py310.py!} {!> ../../docs_src/extra_data_types/tutorial001_an_py310.py!}
``` ```
//// ////
@ -66,7 +66,7 @@ Hier ist ein Beispiel fรผr eine *Pfadoperation* mit Parametern, die einige der o
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="1 3 12-16" ```Python hl_lines="1 3 12-16"
{!> ../../../docs_src/extra_data_types/tutorial001_an_py39.py!} {!> ../../docs_src/extra_data_types/tutorial001_an_py39.py!}
``` ```
//// ////
@ -74,7 +74,7 @@ Hier ist ein Beispiel fรผr eine *Pfadoperation* mit Parametern, die einige der o
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 3 13-17" ```Python hl_lines="1 3 13-17"
{!> ../../../docs_src/extra_data_types/tutorial001_an.py!} {!> ../../docs_src/extra_data_types/tutorial001_an.py!}
``` ```
//// ////
@ -88,7 +88,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1 2 11-15" ```Python hl_lines="1 2 11-15"
{!> ../../../docs_src/extra_data_types/tutorial001_py310.py!} {!> ../../docs_src/extra_data_types/tutorial001_py310.py!}
``` ```
//// ////
@ -102,7 +102,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1 2 12-16" ```Python hl_lines="1 2 12-16"
{!> ../../../docs_src/extra_data_types/tutorial001.py!} {!> ../../docs_src/extra_data_types/tutorial001.py!}
``` ```
//// ////
@ -112,7 +112,7 @@ Beachten Sie, dass die Parameter innerhalb der Funktion ihren natรผrlichen Daten
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="18-19" ```Python hl_lines="18-19"
{!> ../../../docs_src/extra_data_types/tutorial001_an_py310.py!} {!> ../../docs_src/extra_data_types/tutorial001_an_py310.py!}
``` ```
//// ////
@ -120,7 +120,7 @@ Beachten Sie, dass die Parameter innerhalb der Funktion ihren natรผrlichen Daten
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="18-19" ```Python hl_lines="18-19"
{!> ../../../docs_src/extra_data_types/tutorial001_an_py39.py!} {!> ../../docs_src/extra_data_types/tutorial001_an_py39.py!}
``` ```
//// ////
@ -128,7 +128,7 @@ Beachten Sie, dass die Parameter innerhalb der Funktion ihren natรผrlichen Daten
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="19-20" ```Python hl_lines="19-20"
{!> ../../../docs_src/extra_data_types/tutorial001_an.py!} {!> ../../docs_src/extra_data_types/tutorial001_an.py!}
``` ```
//// ////
@ -142,7 +142,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="17-18" ```Python hl_lines="17-18"
{!> ../../../docs_src/extra_data_types/tutorial001_py310.py!} {!> ../../docs_src/extra_data_types/tutorial001_py310.py!}
``` ```
//// ////
@ -156,7 +156,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="18-19" ```Python hl_lines="18-19"
{!> ../../../docs_src/extra_data_types/tutorial001.py!} {!> ../../docs_src/extra_data_types/tutorial001.py!}
``` ```
//// ////

20
docs/de/docs/tutorial/extra-models.md

@ -23,7 +23,7 @@ Hier der generelle Weg, wie die Modelle mit ihren Passwort-Feldern aussehen kรถn
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7 9 14 20 22 27-28 31-33 38-39" ```Python hl_lines="7 9 14 20 22 27-28 31-33 38-39"
{!> ../../../docs_src/extra_models/tutorial001_py310.py!} {!> ../../docs_src/extra_models/tutorial001_py310.py!}
``` ```
//// ////
@ -31,7 +31,7 @@ Hier der generelle Weg, wie die Modelle mit ihren Passwort-Feldern aussehen kรถn
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9 11 16 22 24 29-30 33-35 40-41" ```Python hl_lines="9 11 16 22 24 29-30 33-35 40-41"
{!> ../../../docs_src/extra_models/tutorial001.py!} {!> ../../docs_src/extra_models/tutorial001.py!}
``` ```
//// ////
@ -179,7 +179,7 @@ Auf diese Weise beschreiben wir nur noch die Unterschiede zwischen den Modellen
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7 13-14 17-18 21-22" ```Python hl_lines="7 13-14 17-18 21-22"
{!> ../../../docs_src/extra_models/tutorial002_py310.py!} {!> ../../docs_src/extra_models/tutorial002_py310.py!}
``` ```
//// ////
@ -187,7 +187,7 @@ Auf diese Weise beschreiben wir nur noch die Unterschiede zwischen den Modellen
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9 15-16 19-20 23-24" ```Python hl_lines="9 15-16 19-20 23-24"
{!> ../../../docs_src/extra_models/tutorial002.py!} {!> ../../docs_src/extra_models/tutorial002.py!}
``` ```
//// ////
@ -209,7 +209,7 @@ Listen Sie, wenn Sie eine <a href="https://pydantic-docs.helpmanual.io/usage/typ
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="1 14-15 18-20 33" ```Python hl_lines="1 14-15 18-20 33"
{!> ../../../docs_src/extra_models/tutorial003_py310.py!} {!> ../../docs_src/extra_models/tutorial003_py310.py!}
``` ```
//// ////
@ -217,7 +217,7 @@ Listen Sie, wenn Sie eine <a href="https://pydantic-docs.helpmanual.io/usage/typ
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 14-15 18-20 33" ```Python hl_lines="1 14-15 18-20 33"
{!> ../../../docs_src/extra_models/tutorial003.py!} {!> ../../docs_src/extra_models/tutorial003.py!}
``` ```
//// ////
@ -245,7 +245,7 @@ Verwenden Sie dafรผr Pythons Standard `typing.List` (oder nur `list` in Python 3
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/extra_models/tutorial004_py39.py!} {!> ../../docs_src/extra_models/tutorial004_py39.py!}
``` ```
//// ////
@ -253,7 +253,7 @@ Verwenden Sie dafรผr Pythons Standard `typing.List` (oder nur `list` in Python 3
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 20" ```Python hl_lines="1 20"
{!> ../../../docs_src/extra_models/tutorial004.py!} {!> ../../docs_src/extra_models/tutorial004.py!}
``` ```
//// ////
@ -269,7 +269,7 @@ In diesem Fall kรถnnen Sie `typing.Dict` verwenden (oder nur `dict` in Python 3.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="6" ```Python hl_lines="6"
{!> ../../../docs_src/extra_models/tutorial005_py39.py!} {!> ../../docs_src/extra_models/tutorial005_py39.py!}
``` ```
//// ////
@ -277,7 +277,7 @@ In diesem Fall kรถnnen Sie `typing.Dict` verwenden (oder nur `dict` in Python 3.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1 8" ```Python hl_lines="1 8"
{!> ../../../docs_src/extra_models/tutorial005.py!} {!> ../../docs_src/extra_models/tutorial005.py!}
``` ```
//// ////

16
docs/de/docs/tutorial/first-steps.md

@ -3,7 +3,7 @@
Die einfachste FastAPI-Datei kรถnnte wie folgt aussehen: Die einfachste FastAPI-Datei kรถnnte wie folgt aussehen:
```Python ```Python
{!../../../docs_src/first_steps/tutorial001.py!} {!../../docs_src/first_steps/tutorial001.py!}
``` ```
Kopieren Sie dies in eine Datei `main.py`. Kopieren Sie dies in eine Datei `main.py`.
@ -134,7 +134,7 @@ Ebenfalls kรถnnen Sie es verwenden, um automatisch Code fรผr Clients zu generier
### Schritt 1: Importieren von `FastAPI` ### Schritt 1: Importieren von `FastAPI`
```Python hl_lines="1" ```Python hl_lines="1"
{!../../../docs_src/first_steps/tutorial001.py!} {!../../docs_src/first_steps/tutorial001.py!}
``` ```
`FastAPI` ist eine Python-Klasse, die die gesamte Funktionalitรคt fรผr Ihre API bereitstellt. `FastAPI` ist eine Python-Klasse, die die gesamte Funktionalitรคt fรผr Ihre API bereitstellt.
@ -150,7 +150,7 @@ Sie kรถnnen alle <a href="https://www.starlette.io/" class="external-link" targe
### Schritt 2: Erzeugen einer `FastAPI`-โ€žInstanzโ€œ ### Schritt 2: Erzeugen einer `FastAPI`-โ€žInstanzโ€œ
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/first_steps/tutorial001.py!} {!../../docs_src/first_steps/tutorial001.py!}
``` ```
In diesem Beispiel ist die Variable `app` eine โ€žInstanzโ€œ der Klasse `FastAPI`. In diesem Beispiel ist die Variable `app` eine โ€žInstanzโ€œ der Klasse `FastAPI`.
@ -172,7 +172,7 @@ $ uvicorn main:app --reload
Wenn Sie Ihre Anwendung wie folgt erstellen: Wenn Sie Ihre Anwendung wie folgt erstellen:
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/first_steps/tutorial002.py!} {!../../docs_src/first_steps/tutorial002.py!}
``` ```
Und in eine Datei `main.py` einfรผgen, dann wรผrden Sie `uvicorn` wie folgt aufrufen: Und in eine Datei `main.py` einfรผgen, dann wรผrden Sie `uvicorn` wie folgt aufrufen:
@ -251,7 +251,7 @@ Wir werden sie auch โ€ž**Operationen**โ€œ nennen.
#### Definieren eines *Pfadoperation-Dekorators* #### Definieren eines *Pfadoperation-Dekorators*
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/first_steps/tutorial001.py!} {!../../docs_src/first_steps/tutorial001.py!}
``` ```
Das `@app.get("/")` sagt **FastAPI**, dass die Funktion direkt darunter fรผr die Bearbeitung von Anfragen zustรคndig ist, die an: Das `@app.get("/")` sagt **FastAPI**, dass die Funktion direkt darunter fรผr die Bearbeitung von Anfragen zustรคndig ist, die an:
@ -307,7 +307,7 @@ Das ist unsere โ€ž**Pfadoperation-Funktion**โ€œ:
* **Funktion**: ist die Funktion direkt unter dem โ€žDekoratorโ€œ (unter `@app.get("/")`). * **Funktion**: ist die Funktion direkt unter dem โ€žDekoratorโ€œ (unter `@app.get("/")`).
```Python hl_lines="7" ```Python hl_lines="7"
{!../../../docs_src/first_steps/tutorial001.py!} {!../../docs_src/first_steps/tutorial001.py!}
``` ```
Dies ist eine Python-Funktion. Dies ist eine Python-Funktion.
@ -321,7 +321,7 @@ In diesem Fall handelt es sich um eine `async`-Funktion.
Sie kรถnnten sie auch als normale Funktion anstelle von `async def` definieren: Sie kรถnnten sie auch als normale Funktion anstelle von `async def` definieren:
```Python hl_lines="7" ```Python hl_lines="7"
{!../../../docs_src/first_steps/tutorial003.py!} {!../../docs_src/first_steps/tutorial003.py!}
``` ```
/// note | "Hinweis" /// note | "Hinweis"
@ -333,7 +333,7 @@ Wenn Sie den Unterschied nicht kennen, lesen Sie [Async: *โ€žIn Eile?โ€œ*](../as
### Schritt 5: den Inhalt zurรผckgeben ### Schritt 5: den Inhalt zurรผckgeben
```Python hl_lines="8" ```Python hl_lines="8"
{!../../../docs_src/first_steps/tutorial001.py!} {!../../docs_src/first_steps/tutorial001.py!}
``` ```
Sie kรถnnen ein `dict`, eine `list`, einzelne Werte wie `str`, `int`, usw. zurรผckgeben. Sie kรถnnen ein `dict`, eine `list`, einzelne Werte wie `str`, `int`, usw. zurรผckgeben.

16
docs/de/docs/tutorial/handling-errors.md

@ -26,7 +26,7 @@ Um HTTP-Responses mit Fehlern zum Client zurรผckzugeben, verwenden Sie `HTTPExce
### `HTTPException` importieren ### `HTTPException` importieren
```Python hl_lines="1" ```Python hl_lines="1"
{!../../../docs_src/handling_errors/tutorial001.py!} {!../../docs_src/handling_errors/tutorial001.py!}
``` ```
### Eine `HTTPException` in Ihrem Code auslรถsen ### Eine `HTTPException` in Ihrem Code auslรถsen
@ -42,7 +42,7 @@ Der Vorteil, eine Exception auszulรถsen (`raise`), statt sie zurรผckzugeben (`re
Im folgenden Beispiel lรถsen wir, wenn der Client eine ID anfragt, die nicht existiert, eine Exception mit dem Statuscode `404` aus. Im folgenden Beispiel lรถsen wir, wenn der Client eine ID anfragt, die nicht existiert, eine Exception mit dem Statuscode `404` aus.
```Python hl_lines="11" ```Python hl_lines="11"
{!../../../docs_src/handling_errors/tutorial001.py!} {!../../docs_src/handling_errors/tutorial001.py!}
``` ```
### Die resultierende Response ### Die resultierende Response
@ -82,7 +82,7 @@ Sie mรผssen das wahrscheinlich nicht direkt in ihrem Code verwenden.
Aber falls es in einem fortgeschrittenen Szenario notwendig ist, kรถnnen Sie benutzerdefinierte Header wie folgt hinzufรผgen: Aber falls es in einem fortgeschrittenen Szenario notwendig ist, kรถnnen Sie benutzerdefinierte Header wie folgt hinzufรผgen:
```Python hl_lines="14" ```Python hl_lines="14"
{!../../../docs_src/handling_errors/tutorial002.py!} {!../../docs_src/handling_errors/tutorial002.py!}
``` ```
## Benutzerdefinierte Exceptionhandler definieren ## Benutzerdefinierte Exceptionhandler definieren
@ -96,7 +96,7 @@ Und Sie mรถchten diese Exception global mit FastAPI handhaben.
Sie kรถnnten einen benutzerdefinierten Exceptionhandler mittels `@app.exception_handler()` hinzufรผgen: Sie kรถnnten einen benutzerdefinierten Exceptionhandler mittels `@app.exception_handler()` hinzufรผgen:
```Python hl_lines="5-7 13-18 24" ```Python hl_lines="5-7 13-18 24"
{!../../../docs_src/handling_errors/tutorial003.py!} {!../../docs_src/handling_errors/tutorial003.py!}
``` ```
Wenn Sie nun `/unicorns/yolo` anfragen, `raise`d die *Pfadoperation* eine `UnicornException`. Wenn Sie nun `/unicorns/yolo` anfragen, `raise`d die *Pfadoperation* eine `UnicornException`.
@ -136,7 +136,7 @@ Um diesen zu รผberschreiben, importieren Sie den `RequestValidationError` und ve
Der Exceptionhandler wird einen `Request` und die Exception entgegennehmen. Der Exceptionhandler wird einen `Request` und die Exception entgegennehmen.
```Python hl_lines="2 14-16" ```Python hl_lines="2 14-16"
{!../../../docs_src/handling_errors/tutorial004.py!} {!../../docs_src/handling_errors/tutorial004.py!}
``` ```
Wenn Sie nun `/items/foo` besuchen, erhalten Sie statt des Default-JSON-Errors: Wenn Sie nun `/items/foo` besuchen, erhalten Sie statt des Default-JSON-Errors:
@ -189,7 +189,7 @@ Genauso kรถnnen Sie den `HTTPException`-Handler รผberschreiben.
Zum Beispiel kรถnnten Sie eine Klartext-Response statt JSON fรผr diese Fehler zurรผckgeben wollen: Zum Beispiel kรถnnten Sie eine Klartext-Response statt JSON fรผr diese Fehler zurรผckgeben wollen:
```Python hl_lines="3-4 9-11 22" ```Python hl_lines="3-4 9-11 22"
{!../../../docs_src/handling_errors/tutorial004.py!} {!../../docs_src/handling_errors/tutorial004.py!}
``` ```
/// note | "Technische Details" /// note | "Technische Details"
@ -207,7 +207,7 @@ Der `RequestValidationError` enthรคlt den empfangenen `body` mit den ungรผltigen
Sie kรถnnten diesen verwenden, wรคhrend Sie Ihre Anwendung entwickeln, um den Body zu loggen und zu debuggen, ihn zum Benutzer zurรผckzugeben, usw. Sie kรถnnten diesen verwenden, wรคhrend Sie Ihre Anwendung entwickeln, um den Body zu loggen und zu debuggen, ihn zum Benutzer zurรผckzugeben, usw.
```Python hl_lines="14" ```Python hl_lines="14"
{!../../../docs_src/handling_errors/tutorial005.py!} {!../../docs_src/handling_errors/tutorial005.py!}
``` ```
Jetzt versuchen Sie, einen ungรผltigen Artikel zu senden: Jetzt versuchen Sie, einen ungรผltigen Artikel zu senden:
@ -265,7 +265,7 @@ from starlette.exceptions import HTTPException as StarletteHTTPException
Wenn Sie die Exception zusammen mit denselben Default-Exceptionhandlern von **FastAPI** verwenden mรถchten, kรถnnen Sie die Default-Exceptionhandler von `fastapi.Exception_handlers` importieren und wiederverwenden: Wenn Sie die Exception zusammen mit denselben Default-Exceptionhandlern von **FastAPI** verwenden mรถchten, kรถnnen Sie die Default-Exceptionhandler von `fastapi.Exception_handlers` importieren und wiederverwenden:
```Python hl_lines="2-5 15 21" ```Python hl_lines="2-5 15 21"
{!../../../docs_src/handling_errors/tutorial006.py!} {!../../docs_src/handling_errors/tutorial006.py!}
``` ```
In diesem Beispiel `print`en Sie nur den Fehler mit einer sehr ausdrucksstarken Nachricht, aber Sie sehen, worauf wir hinauswollen. Sie kรถnnen mit der Exception etwas machen und dann einfach die Default-Exceptionhandler wiederverwenden. In diesem Beispiel `print`en Sie nur den Fehler mit einer sehr ausdrucksstarken Nachricht, aber Sie sehen, worauf wir hinauswollen. Sie kรถnnen mit der Exception etwas machen und dann einfach die Default-Exceptionhandler wiederverwenden.

42
docs/de/docs/tutorial/header-params.md

@ -9,7 +9,7 @@ Importieren Sie zuerst `Header`:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/header_params/tutorial001_an_py310.py!} {!> ../../docs_src/header_params/tutorial001_an_py310.py!}
``` ```
//// ////
@ -17,7 +17,7 @@ Importieren Sie zuerst `Header`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/header_params/tutorial001_an_py39.py!} {!> ../../docs_src/header_params/tutorial001_an_py39.py!}
``` ```
//// ////
@ -25,7 +25,7 @@ Importieren Sie zuerst `Header`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/header_params/tutorial001_an.py!} {!> ../../docs_src/header_params/tutorial001_an.py!}
``` ```
//// ////
@ -39,7 +39,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/header_params/tutorial001_py310.py!} {!> ../../docs_src/header_params/tutorial001_py310.py!}
``` ```
//// ////
@ -53,7 +53,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/header_params/tutorial001.py!} {!> ../../docs_src/header_params/tutorial001.py!}
``` ```
//// ////
@ -67,7 +67,7 @@ Der erste Wert ist der Typ. Sie kรถnnen `Header` die gehabten Extra Validierungs
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial001_an_py310.py!} {!> ../../docs_src/header_params/tutorial001_an_py310.py!}
``` ```
//// ////
@ -75,7 +75,7 @@ Der erste Wert ist der Typ. Sie kรถnnen `Header` die gehabten Extra Validierungs
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial001_an_py39.py!} {!> ../../docs_src/header_params/tutorial001_an_py39.py!}
``` ```
//// ////
@ -83,7 +83,7 @@ Der erste Wert ist der Typ. Sie kรถnnen `Header` die gehabten Extra Validierungs
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/header_params/tutorial001_an.py!} {!> ../../docs_src/header_params/tutorial001_an.py!}
``` ```
//// ////
@ -97,7 +97,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/header_params/tutorial001_py310.py!} {!> ../../docs_src/header_params/tutorial001_py310.py!}
``` ```
//// ////
@ -111,7 +111,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial001.py!} {!> ../../docs_src/header_params/tutorial001.py!}
``` ```
//// ////
@ -149,7 +149,7 @@ Wenn Sie aus irgendeinem Grund das automatische Konvertieren von Unterstrichen z
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/header_params/tutorial002_an_py310.py!} {!> ../../docs_src/header_params/tutorial002_an_py310.py!}
``` ```
//// ////
@ -157,7 +157,7 @@ Wenn Sie aus irgendeinem Grund das automatische Konvertieren von Unterstrichen z
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/header_params/tutorial002_an_py39.py!} {!> ../../docs_src/header_params/tutorial002_an_py39.py!}
``` ```
//// ////
@ -165,7 +165,7 @@ Wenn Sie aus irgendeinem Grund das automatische Konvertieren von Unterstrichen z
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/header_params/tutorial002_an.py!} {!> ../../docs_src/header_params/tutorial002_an.py!}
``` ```
//// ////
@ -179,7 +179,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/header_params/tutorial002_py310.py!} {!> ../../docs_src/header_params/tutorial002_py310.py!}
``` ```
//// ////
@ -193,7 +193,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/header_params/tutorial002.py!} {!> ../../docs_src/header_params/tutorial002.py!}
``` ```
//// ////
@ -217,7 +217,7 @@ Um zum Beispiel einen Header `X-Token` zu deklarieren, der mehrmals vorkommen ka
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial003_an_py310.py!} {!> ../../docs_src/header_params/tutorial003_an_py310.py!}
``` ```
//// ////
@ -225,7 +225,7 @@ Um zum Beispiel einen Header `X-Token` zu deklarieren, der mehrmals vorkommen ka
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial003_an_py39.py!} {!> ../../docs_src/header_params/tutorial003_an_py39.py!}
``` ```
//// ////
@ -233,7 +233,7 @@ Um zum Beispiel einen Header `X-Token` zu deklarieren, der mehrmals vorkommen ka
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/header_params/tutorial003_an.py!} {!> ../../docs_src/header_params/tutorial003_an.py!}
``` ```
//// ////
@ -247,7 +247,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/header_params/tutorial003_py310.py!} {!> ../../docs_src/header_params/tutorial003_py310.py!}
``` ```
//// ////
@ -261,7 +261,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial003_py39.py!} {!> ../../docs_src/header_params/tutorial003_py39.py!}
``` ```
//// ////
@ -275,7 +275,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/header_params/tutorial003.py!} {!> ../../docs_src/header_params/tutorial003.py!}
``` ```
//// ////

12
docs/de/docs/tutorial/metadata.md

@ -19,7 +19,7 @@ Sie kรถnnen die folgenden Felder festlegen, welche in der OpenAPI-Spezifikation
Sie kรถnnen diese wie folgt setzen: Sie kรถnnen diese wie folgt setzen:
```Python hl_lines="3-16 19-32" ```Python hl_lines="3-16 19-32"
{!../../../docs_src/metadata/tutorial001.py!} {!../../docs_src/metadata/tutorial001.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -39,7 +39,7 @@ Seit OpenAPI 3.1.0 und FastAPI 0.99.0 kรถnnen Sie die `license_info` auch mit ei
Zum Beispiel: Zum Beispiel:
```Python hl_lines="31" ```Python hl_lines="31"
{!../../../docs_src/metadata/tutorial001_1.py!} {!../../docs_src/metadata/tutorial001_1.py!}
``` ```
## Metadaten fรผr Tags ## Metadaten fรผr Tags
@ -63,7 +63,7 @@ Versuchen wir das an einem Beispiel mit Tags fรผr `users` und `items`.
Erstellen Sie Metadaten fรผr Ihre Tags und รผbergeben Sie sie an den Parameter `openapi_tags`: Erstellen Sie Metadaten fรผr Ihre Tags und รผbergeben Sie sie an den Parameter `openapi_tags`:
```Python hl_lines="3-16 18" ```Python hl_lines="3-16 18"
{!../../../docs_src/metadata/tutorial004.py!} {!../../docs_src/metadata/tutorial004.py!}
``` ```
Beachten Sie, dass Sie Markdown in den Beschreibungen verwenden kรถnnen. Beispielsweise wird โ€žloginโ€œ in Fettschrift (**login**) und โ€žfancyโ€œ in Kursivschrift (_fancy_) angezeigt. Beachten Sie, dass Sie Markdown in den Beschreibungen verwenden kรถnnen. Beispielsweise wird โ€žloginโ€œ in Fettschrift (**login**) und โ€žfancyโ€œ in Kursivschrift (_fancy_) angezeigt.
@ -79,7 +79,7 @@ Sie mรผssen nicht fรผr alle von Ihnen verwendeten Tags Metadaten hinzufรผgen.
Verwenden Sie den Parameter `tags` mit Ihren *Pfadoperationen* (und `APIRouter`n), um diese verschiedenen Tags zuzuweisen: Verwenden Sie den Parameter `tags` mit Ihren *Pfadoperationen* (und `APIRouter`n), um diese verschiedenen Tags zuzuweisen:
```Python hl_lines="21 26" ```Python hl_lines="21 26"
{!../../../docs_src/metadata/tutorial004.py!} {!../../docs_src/metadata/tutorial004.py!}
``` ```
/// info /// info
@ -109,7 +109,7 @@ Sie kรถnnen das aber mit dem Parameter `openapi_url` konfigurieren.
Um beispielsweise festzulegen, dass es unter `/api/v1/openapi.json` bereitgestellt wird: Um beispielsweise festzulegen, dass es unter `/api/v1/openapi.json` bereitgestellt wird:
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/metadata/tutorial002.py!} {!../../docs_src/metadata/tutorial002.py!}
``` ```
Wenn Sie das OpenAPI-Schema vollstรคndig deaktivieren mรถchten, kรถnnen Sie `openapi_url=None` festlegen, wodurch auch die Dokumentationsbenutzeroberflรคchen deaktiviert werden, die es verwenden. Wenn Sie das OpenAPI-Schema vollstรคndig deaktivieren mรถchten, kรถnnen Sie `openapi_url=None` festlegen, wodurch auch die Dokumentationsbenutzeroberflรคchen deaktiviert werden, die es verwenden.
@ -128,5 +128,5 @@ Sie kรถnnen die beiden enthaltenen Dokumentationsbenutzeroberflรคchen konfigurie
Um beispielsweise Swagger UI so einzustellen, dass sie unter `/documentation` bereitgestellt wird, und ReDoc zu deaktivieren: Um beispielsweise Swagger UI so einzustellen, dass sie unter `/documentation` bereitgestellt wird, und ReDoc zu deaktivieren:
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/metadata/tutorial003.py!} {!../../docs_src/metadata/tutorial003.py!}
``` ```

4
docs/de/docs/tutorial/middleware.md

@ -32,7 +32,7 @@ Die Middleware-Funktion erhรคlt:
* Sie kรถnnen die `response` dann weiter modifizieren, bevor Sie sie zurรผckgeben. * Sie kรถnnen die `response` dann weiter modifizieren, bevor Sie sie zurรผckgeben.
```Python hl_lines="8-9 11 14" ```Python hl_lines="8-9 11 14"
{!../../../docs_src/middleware/tutorial001.py!} {!../../docs_src/middleware/tutorial001.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -60,7 +60,7 @@ Und auch nachdem die `response` generiert wurde, bevor sie zurรผckgegeben wird.
Sie kรถnnten beispielsweise einen benutzerdefinierten Header `X-Process-Time` hinzufรผgen, der die Zeit in Sekunden enthรคlt, die benรถtigt wurde, um den Request zu verarbeiten und eine Response zu generieren: Sie kรถnnten beispielsweise einen benutzerdefinierten Header `X-Process-Time` hinzufรผgen, der die Zeit in Sekunden enthรคlt, die benรถtigt wurde, um den Request zu verarbeiten und eine Response zu generieren:
```Python hl_lines="10 12-13" ```Python hl_lines="10 12-13"
{!../../../docs_src/middleware/tutorial001.py!} {!../../docs_src/middleware/tutorial001.py!}
``` ```
## Andere Middlewares ## Andere Middlewares

34
docs/de/docs/tutorial/path-operation-configuration.md

@ -19,7 +19,7 @@ Aber falls Sie sich nicht mehr erinnern, wofรผr jede Nummer steht, kรถnnen Sie d
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="1 15" ```Python hl_lines="1 15"
{!> ../../../docs_src/path_operation_configuration/tutorial001_py310.py!} {!> ../../docs_src/path_operation_configuration/tutorial001_py310.py!}
``` ```
//// ////
@ -27,7 +27,7 @@ Aber falls Sie sich nicht mehr erinnern, wofรผr jede Nummer steht, kรถnnen Sie d
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="3 17" ```Python hl_lines="3 17"
{!> ../../../docs_src/path_operation_configuration/tutorial001_py39.py!} {!> ../../docs_src/path_operation_configuration/tutorial001_py39.py!}
``` ```
//// ////
@ -35,7 +35,7 @@ Aber falls Sie sich nicht mehr erinnern, wofรผr jede Nummer steht, kรถnnen Sie d
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="3 17" ```Python hl_lines="3 17"
{!> ../../../docs_src/path_operation_configuration/tutorial001.py!} {!> ../../docs_src/path_operation_configuration/tutorial001.py!}
``` ```
//// ////
@ -57,7 +57,7 @@ Sie kรถnnen Ihrer *Pfadoperation* Tags hinzufรผgen, mittels des Parameters `tags
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="15 20 25" ```Python hl_lines="15 20 25"
{!> ../../../docs_src/path_operation_configuration/tutorial002_py310.py!} {!> ../../docs_src/path_operation_configuration/tutorial002_py310.py!}
``` ```
//// ////
@ -65,7 +65,7 @@ Sie kรถnnen Ihrer *Pfadoperation* Tags hinzufรผgen, mittels des Parameters `tags
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="17 22 27" ```Python hl_lines="17 22 27"
{!> ../../../docs_src/path_operation_configuration/tutorial002_py39.py!} {!> ../../docs_src/path_operation_configuration/tutorial002_py39.py!}
``` ```
//// ////
@ -73,7 +73,7 @@ Sie kรถnnen Ihrer *Pfadoperation* Tags hinzufรผgen, mittels des Parameters `tags
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="17 22 27" ```Python hl_lines="17 22 27"
{!> ../../../docs_src/path_operation_configuration/tutorial002.py!} {!> ../../docs_src/path_operation_configuration/tutorial002.py!}
``` ```
//// ////
@ -91,7 +91,7 @@ In diesem Fall macht es Sinn, die Tags in einem `Enum` zu speichern.
**FastAPI** unterstรผtzt diese genauso wie einfache Strings: **FastAPI** unterstรผtzt diese genauso wie einfache Strings:
```Python hl_lines="1 8-10 13 18" ```Python hl_lines="1 8-10 13 18"
{!../../../docs_src/path_operation_configuration/tutorial002b.py!} {!../../docs_src/path_operation_configuration/tutorial002b.py!}
``` ```
## Zusammenfassung und Beschreibung ## Zusammenfassung und Beschreibung
@ -101,7 +101,7 @@ Sie kรถnnen eine Zusammenfassung (`summary`) und eine Beschreibung (`description
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="18-19" ```Python hl_lines="18-19"
{!> ../../../docs_src/path_operation_configuration/tutorial003_py310.py!} {!> ../../docs_src/path_operation_configuration/tutorial003_py310.py!}
``` ```
//// ////
@ -109,7 +109,7 @@ Sie kรถnnen eine Zusammenfassung (`summary`) und eine Beschreibung (`description
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="20-21" ```Python hl_lines="20-21"
{!> ../../../docs_src/path_operation_configuration/tutorial003_py39.py!} {!> ../../docs_src/path_operation_configuration/tutorial003_py39.py!}
``` ```
//// ////
@ -117,7 +117,7 @@ Sie kรถnnen eine Zusammenfassung (`summary`) und eine Beschreibung (`description
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="20-21" ```Python hl_lines="20-21"
{!> ../../../docs_src/path_operation_configuration/tutorial003.py!} {!> ../../docs_src/path_operation_configuration/tutorial003.py!}
``` ```
//// ////
@ -131,7 +131,7 @@ Sie kรถnnen im Docstring <a href="https://en.wikipedia.org/wiki/Markdown" class=
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="17-25" ```Python hl_lines="17-25"
{!> ../../../docs_src/path_operation_configuration/tutorial004_py310.py!} {!> ../../docs_src/path_operation_configuration/tutorial004_py310.py!}
``` ```
//// ////
@ -139,7 +139,7 @@ Sie kรถnnen im Docstring <a href="https://en.wikipedia.org/wiki/Markdown" class=
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="19-27" ```Python hl_lines="19-27"
{!> ../../../docs_src/path_operation_configuration/tutorial004_py39.py!} {!> ../../docs_src/path_operation_configuration/tutorial004_py39.py!}
``` ```
//// ////
@ -147,7 +147,7 @@ Sie kรถnnen im Docstring <a href="https://en.wikipedia.org/wiki/Markdown" class=
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="19-27" ```Python hl_lines="19-27"
{!> ../../../docs_src/path_operation_configuration/tutorial004.py!} {!> ../../docs_src/path_operation_configuration/tutorial004.py!}
``` ```
//// ////
@ -163,7 +163,7 @@ Die Response kรถnnen Sie mit dem Parameter `response_description` beschreiben:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/path_operation_configuration/tutorial005_py310.py!} {!> ../../docs_src/path_operation_configuration/tutorial005_py310.py!}
``` ```
//// ////
@ -171,7 +171,7 @@ Die Response kรถnnen Sie mit dem Parameter `response_description` beschreiben:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="21" ```Python hl_lines="21"
{!> ../../../docs_src/path_operation_configuration/tutorial005_py39.py!} {!> ../../docs_src/path_operation_configuration/tutorial005_py39.py!}
``` ```
//// ////
@ -179,7 +179,7 @@ Die Response kรถnnen Sie mit dem Parameter `response_description` beschreiben:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="21" ```Python hl_lines="21"
{!> ../../../docs_src/path_operation_configuration/tutorial005.py!} {!> ../../docs_src/path_operation_configuration/tutorial005.py!}
``` ```
//// ////
@ -205,7 +205,7 @@ Daher, wenn Sie keine vergeben, wird **FastAPI** automatisch eine fรผr โ€žErfolg
Wenn Sie eine *Pfadoperation* als <abbr title="deprecated โ€“ obsolet, veraltet: Es soll nicht mehr verwendet werden">deprecated</abbr> kennzeichnen mรถchten, ohne sie zu entfernen, fรผgen Sie den Parameter `deprecated` hinzu: Wenn Sie eine *Pfadoperation* als <abbr title="deprecated โ€“ obsolet, veraltet: Es soll nicht mehr verwendet werden">deprecated</abbr> kennzeichnen mรถchten, ohne sie zu entfernen, fรผgen Sie den Parameter `deprecated` hinzu:
```Python hl_lines="16" ```Python hl_lines="16"
{!../../../docs_src/path_operation_configuration/tutorial006.py!} {!../../docs_src/path_operation_configuration/tutorial006.py!}
``` ```
Sie wird in der interaktiven Dokumentation gut sichtbar als deprecated markiert werden: Sie wird in der interaktiven Dokumentation gut sichtbar als deprecated markiert werden:

50
docs/de/docs/tutorial/path-params-numeric-validations.md

@ -9,7 +9,7 @@ Importieren Sie zuerst `Path` von `fastapi`, und importieren Sie `Annotated`.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="1 3" ```Python hl_lines="1 3"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py!}
``` ```
//// ////
@ -17,7 +17,7 @@ Importieren Sie zuerst `Path` von `fastapi`, und importieren Sie `Annotated`.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="1 3" ```Python hl_lines="1 3"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001_an_py39.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001_an_py39.py!}
``` ```
//// ////
@ -25,7 +25,7 @@ Importieren Sie zuerst `Path` von `fastapi`, und importieren Sie `Annotated`.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="3-4" ```Python hl_lines="3-4"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001_an.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001_an.py!}
``` ```
//// ////
@ -39,7 +39,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001_py310.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001_py310.py!}
``` ```
//// ////
@ -53,7 +53,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001.py!}
``` ```
//// ////
@ -77,7 +77,7 @@ Um zum Beispiel einen `title`-Metadaten-Wert fรผr den Pfad-Parameter `item_id` z
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001_an_py310.py!}
``` ```
//// ////
@ -85,7 +85,7 @@ Um zum Beispiel einen `title`-Metadaten-Wert fรผr den Pfad-Parameter `item_id` z
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001_an_py39.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001_an_py39.py!}
``` ```
//// ////
@ -93,7 +93,7 @@ Um zum Beispiel einen `title`-Metadaten-Wert fรผr den Pfad-Parameter `item_id` z
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001_an.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001_an.py!}
``` ```
//// ////
@ -107,7 +107,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001_py310.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001_py310.py!}
``` ```
//// ////
@ -121,7 +121,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/path_params_numeric_validations/tutorial001.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial001.py!}
``` ```
//// ////
@ -167,7 +167,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/path_params_numeric_validations/tutorial002.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial002.py!}
``` ```
//// ////
@ -177,7 +177,7 @@ Aber bedenken Sie, dass Sie dieses Problem nicht haben, wenn Sie `Annotated` ver
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/path_params_numeric_validations/tutorial002_an_py39.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial002_an_py39.py!}
``` ```
//// ////
@ -185,7 +185,7 @@ Aber bedenken Sie, dass Sie dieses Problem nicht haben, wenn Sie `Annotated` ver
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/path_params_numeric_validations/tutorial002_an.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial002_an.py!}
``` ```
//// ////
@ -214,7 +214,7 @@ Wenn Sie eines der folgenden Dinge tun mรถchten:
Python macht nichts mit diesem `*`, aber es wird wissen, dass alle folgenden Parameter als <abbr title="Keyword-Argument โ€“ Schlรผsselwort-Argument: Das Argument wird anhand seines Namens erkannt, nicht anhand seiner Reihenfolge in der Argumentliste">Keyword-Argumente</abbr> (Schlรผssel-Wert-Paare), auch bekannt als <abbr title="Von: K-ey W-ord Arg-uments"><code>kwargs</code></abbr>, verwendet werden. Selbst wenn diese keinen Defaultwert haben. Python macht nichts mit diesem `*`, aber es wird wissen, dass alle folgenden Parameter als <abbr title="Keyword-Argument โ€“ Schlรผsselwort-Argument: Das Argument wird anhand seines Namens erkannt, nicht anhand seiner Reihenfolge in der Argumentliste">Keyword-Argumente</abbr> (Schlรผssel-Wert-Paare), auch bekannt als <abbr title="Von: K-ey W-ord Arg-uments"><code>kwargs</code></abbr>, verwendet werden. Selbst wenn diese keinen Defaultwert haben.
```Python hl_lines="7" ```Python hl_lines="7"
{!../../../docs_src/path_params_numeric_validations/tutorial003.py!} {!../../docs_src/path_params_numeric_validations/tutorial003.py!}
``` ```
### Besser mit `Annotated` ### Besser mit `Annotated`
@ -224,7 +224,7 @@ Bedenken Sie, dass Sie, wenn Sie `Annotated` verwenden, dieses Problem nicht hab
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/path_params_numeric_validations/tutorial003_an_py39.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial003_an_py39.py!}
``` ```
//// ////
@ -232,7 +232,7 @@ Bedenken Sie, dass Sie, wenn Sie `Annotated` verwenden, dieses Problem nicht hab
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/path_params_numeric_validations/tutorial003_an.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial003_an.py!}
``` ```
//// ////
@ -245,7 +245,7 @@ Hier, mit `ge=1`, wird festgelegt, dass `item_id` eine Ganzzahl benรถtigt, die g
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/path_params_numeric_validations/tutorial004_an_py39.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial004_an_py39.py!}
``` ```
//// ////
@ -253,7 +253,7 @@ Hier, mit `ge=1`, wird festgelegt, dass `item_id` eine Ganzzahl benรถtigt, die g
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/path_params_numeric_validations/tutorial004_an.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial004_an.py!}
``` ```
//// ////
@ -267,7 +267,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/path_params_numeric_validations/tutorial004.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial004.py!}
``` ```
//// ////
@ -282,7 +282,7 @@ Das Gleiche trifft zu auf:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/path_params_numeric_validations/tutorial005_an_py39.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial005_an_py39.py!}
``` ```
//// ////
@ -290,7 +290,7 @@ Das Gleiche trifft zu auf:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/path_params_numeric_validations/tutorial005_an.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial005_an.py!}
``` ```
//// ////
@ -304,7 +304,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/path_params_numeric_validations/tutorial005.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial005.py!}
``` ```
//// ////
@ -322,7 +322,7 @@ Das gleiche gilt fรผr <abbr title="less than โ€“ kleiner als"><code>lt</code></a
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="13" ```Python hl_lines="13"
{!> ../../../docs_src/path_params_numeric_validations/tutorial006_an_py39.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial006_an_py39.py!}
``` ```
//// ////
@ -330,7 +330,7 @@ Das gleiche gilt fรผr <abbr title="less than โ€“ kleiner als"><code>lt</code></a
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/path_params_numeric_validations/tutorial006_an.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial006_an.py!}
``` ```
//// ////
@ -344,7 +344,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/path_params_numeric_validations/tutorial006.py!} {!> ../../docs_src/path_params_numeric_validations/tutorial006.py!}
``` ```
//// ////

20
docs/de/docs/tutorial/path-params.md

@ -3,7 +3,7 @@
Sie kรถnnen Pfad-โ€žParameterโ€œ oder -โ€žVariablenโ€œ mit der gleichen Syntax deklarieren, welche in Python-<abbr title="Format-String โ€“ Formatierter String: Der String enthรคlt Variablen, die mit geschweiften Klammern umschlossen sind. Solche Stellen werden durch den Wert der Variable ersetzt">Format-Strings</abbr> verwendet wird: Sie kรถnnen Pfad-โ€žParameterโ€œ oder -โ€žVariablenโ€œ mit der gleichen Syntax deklarieren, welche in Python-<abbr title="Format-String โ€“ Formatierter String: Der String enthรคlt Variablen, die mit geschweiften Klammern umschlossen sind. Solche Stellen werden durch den Wert der Variable ersetzt">Format-Strings</abbr> verwendet wird:
```Python hl_lines="6-7" ```Python hl_lines="6-7"
{!../../../docs_src/path_params/tutorial001.py!} {!../../docs_src/path_params/tutorial001.py!}
``` ```
Der Wert des Pfad-Parameters `item_id` wird Ihrer Funktion als das Argument `item_id` รผbergeben. Der Wert des Pfad-Parameters `item_id` wird Ihrer Funktion als das Argument `item_id` รผbergeben.
@ -19,7 +19,7 @@ Wenn Sie dieses Beispiel ausfรผhren und auf <a href="http://127.0.0.1:8000/items
Sie kรถnnen den Typ eines Pfad-Parameters in der Argumentliste der Funktion deklarieren, mit Standard-Python-Typannotationen: Sie kรถnnen den Typ eines Pfad-Parameters in der Argumentliste der Funktion deklarieren, mit Standard-Python-Typannotationen:
```Python hl_lines="7" ```Python hl_lines="7"
{!../../../docs_src/path_params/tutorial002.py!} {!../../docs_src/path_params/tutorial002.py!}
``` ```
In diesem Fall wird `item_id` als `int` deklariert, also als Ganzzahl. In diesem Fall wird `item_id` als `int` deklariert, also als Ganzzahl.
@ -124,7 +124,7 @@ Und Sie haben auch einen Pfad `/users/{user_id}`, um Daten รผber einen spezifisc
Weil *Pfadoperationen* in ihrer Reihenfolge ausgewertet werden, mรผssen Sie sicherstellen, dass der Pfad `/users/me` vor `/users/{user_id}` deklariert wurde: Weil *Pfadoperationen* in ihrer Reihenfolge ausgewertet werden, mรผssen Sie sicherstellen, dass der Pfad `/users/me` vor `/users/{user_id}` deklariert wurde:
```Python hl_lines="6 11" ```Python hl_lines="6 11"
{!../../../docs_src/path_params/tutorial003.py!} {!../../docs_src/path_params/tutorial003.py!}
``` ```
Ansonsten wรผrde der Pfad fรผr `/users/{user_id}` auch `/users/me` auswerten, und annehmen, dass ein Parameter `user_id` mit dem Wert `"me"` รผbergeben wurde. Ansonsten wรผrde der Pfad fรผr `/users/{user_id}` auch `/users/me` auswerten, und annehmen, dass ein Parameter `user_id` mit dem Wert `"me"` รผbergeben wurde.
@ -132,7 +132,7 @@ Ansonsten wรผrde der Pfad fรผr `/users/{user_id}` auch `/users/me` auswerten, un
Sie kรถnnen eine Pfadoperation auch nicht erneut definieren: Sie kรถnnen eine Pfadoperation auch nicht erneut definieren:
```Python hl_lines="6 11" ```Python hl_lines="6 11"
{!../../../docs_src/path_params/tutorial003b.py!} {!../../docs_src/path_params/tutorial003b.py!}
``` ```
Die erste Definition wird immer verwendet werden, da ihr Pfad zuerst รผbereinstimmt. Die erste Definition wird immer verwendet werden, da ihr Pfad zuerst รผbereinstimmt.
@ -150,7 +150,7 @@ Indem Sie von `str` erben, weiรŸ die API Dokumentation, dass die Werte des Enums
Erstellen Sie dann Klassen-Attribute mit festgelegten Werten, welches die erlaubten Werte sein werden: Erstellen Sie dann Klassen-Attribute mit festgelegten Werten, welches die erlaubten Werte sein werden:
```Python hl_lines="1 6-9" ```Python hl_lines="1 6-9"
{!../../../docs_src/path_params/tutorial005.py!} {!../../docs_src/path_params/tutorial005.py!}
``` ```
/// info /// info
@ -170,7 +170,7 @@ Falls Sie sich fragen, was โ€žAlexNetโ€œ, โ€žResNetโ€œ und โ€žLeNetโ€œ ist, das
Dann erstellen Sie einen *Pfad-Parameter*, der als Typ die gerade erstellte Enum-Klasse hat (`ModelName`): Dann erstellen Sie einen *Pfad-Parameter*, der als Typ die gerade erstellte Enum-Klasse hat (`ModelName`):
```Python hl_lines="16" ```Python hl_lines="16"
{!../../../docs_src/path_params/tutorial005.py!} {!../../docs_src/path_params/tutorial005.py!}
``` ```
### Testen Sie es in der API-Dokumentation ### Testen Sie es in der API-Dokumentation
@ -188,7 +188,7 @@ Der *Pfad-Parameter* wird ein *<abbr title="Member โ€“ Mitglied: Einer der mรถgl
Sie kรถnnen ihn mit einem Member Ihres Enums `ModelName` vergleichen: Sie kรถnnen ihn mit einem Member Ihres Enums `ModelName` vergleichen:
```Python hl_lines="17" ```Python hl_lines="17"
{!../../../docs_src/path_params/tutorial005.py!} {!../../docs_src/path_params/tutorial005.py!}
``` ```
#### *Enum-Wert* erhalten #### *Enum-Wert* erhalten
@ -196,7 +196,7 @@ Sie kรถnnen ihn mit einem Member Ihres Enums `ModelName` vergleichen:
Den tatsรคchlichen Wert (in diesem Fall ein `str`) erhalten Sie via `model_name.value`, oder generell, `ihr_enum_member.value`: Den tatsรคchlichen Wert (in diesem Fall ein `str`) erhalten Sie via `model_name.value`, oder generell, `ihr_enum_member.value`:
```Python hl_lines="20" ```Python hl_lines="20"
{!../../../docs_src/path_params/tutorial005.py!} {!../../docs_src/path_params/tutorial005.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -212,7 +212,7 @@ Sie kรถnnen *Enum-Member* in ihrer *Pfadoperation* zurรผckgeben, sogar verschach
Diese werden zu ihren entsprechenden Werten konvertiert (in diesem Fall Strings), bevor sie zum Client รผbertragen werden: Diese werden zu ihren entsprechenden Werten konvertiert (in diesem Fall Strings), bevor sie zum Client รผbertragen werden:
```Python hl_lines="18 21 23" ```Python hl_lines="18 21 23"
{!../../../docs_src/path_params/tutorial005.py!} {!../../docs_src/path_params/tutorial005.py!}
``` ```
In Ihrem Client erhalten Sie eine JSON-Response, wie etwa: In Ihrem Client erhalten Sie eine JSON-Response, wie etwa:
@ -253,7 +253,7 @@ In diesem Fall ist der Name des Parameters `file_path`. Der letzte Teil, `:path`
Sie verwenden das also wie folgt: Sie verwenden das also wie folgt:
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/path_params/tutorial004.py!} {!../../docs_src/path_params/tutorial004.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"

142
docs/de/docs/tutorial/query-params-str-validations.md

@ -7,7 +7,7 @@ Nehmen wir als Beispiel die folgende Anwendung:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial001_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial001_py310.py!}
``` ```
//// ////
@ -15,7 +15,7 @@ Nehmen wir als Beispiel die folgende Anwendung:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial001.py!} {!> ../../docs_src/query_params_str_validations/tutorial001.py!}
``` ```
//// ////
@ -46,7 +46,7 @@ Importieren Sie zuerst:
In Python 3.9 oder darรผber, ist `Annotated` Teil der Standardbibliothek, also kรถnnen Sie es von `typing` importieren. In Python 3.9 oder darรผber, ist `Annotated` Teil der Standardbibliothek, also kรถnnen Sie es von `typing` importieren.
```Python hl_lines="1 3" ```Python hl_lines="1 3"
{!> ../../../docs_src/query_params_str_validations/tutorial002_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial002_an_py310.py!}
``` ```
//// ////
@ -58,7 +58,7 @@ In Versionen unter Python 3.9 importieren Sie `Annotated` von `typing_extensions
Es wird bereits mit FastAPI installiert sein. Es wird bereits mit FastAPI installiert sein.
```Python hl_lines="3-4" ```Python hl_lines="3-4"
{!> ../../../docs_src/query_params_str_validations/tutorial002_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial002_an.py!}
``` ```
//// ////
@ -126,7 +126,7 @@ Jetzt, da wir `Annotated` fรผr unsere Metadaten deklariert haben, fรผgen Sie `Qu
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial002_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial002_an_py310.py!}
``` ```
//// ////
@ -134,7 +134,7 @@ Jetzt, da wir `Annotated` fรผr unsere Metadaten deklariert haben, fรผgen Sie `Qu
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial002_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial002_an.py!}
``` ```
//// ////
@ -164,7 +164,7 @@ So wรผrden Sie `Query()` als Defaultwert Ihres Funktionsparameters verwenden, de
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial002_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial002_py310.py!}
``` ```
//// ////
@ -172,7 +172,7 @@ So wรผrden Sie `Query()` als Defaultwert Ihres Funktionsparameters verwenden, de
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial002.py!} {!> ../../docs_src/query_params_str_validations/tutorial002.py!}
``` ```
//// ////
@ -278,7 +278,7 @@ Sie kรถnnen auch einen Parameter `min_length` hinzufรผgen:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial003_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial003_an_py310.py!}
``` ```
//// ////
@ -286,7 +286,7 @@ Sie kรถnnen auch einen Parameter `min_length` hinzufรผgen:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial003_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial003_an_py39.py!}
``` ```
//// ////
@ -294,7 +294,7 @@ Sie kรถnnen auch einen Parameter `min_length` hinzufรผgen:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial003_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial003_an.py!}
``` ```
//// ////
@ -308,7 +308,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial003_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial003_py310.py!}
``` ```
//// ////
@ -322,7 +322,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial003.py!} {!> ../../docs_src/query_params_str_validations/tutorial003.py!}
``` ```
//// ////
@ -334,7 +334,7 @@ Sie kรถnnen einen <abbr title="Ein regulรคrer Ausdruck, auch regex oder regexp g
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial004_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial004_an_py310.py!}
``` ```
//// ////
@ -342,7 +342,7 @@ Sie kรถnnen einen <abbr title="Ein regulรคrer Ausdruck, auch regex oder regexp g
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial004_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial004_an_py39.py!}
``` ```
//// ////
@ -350,7 +350,7 @@ Sie kรถnnen einen <abbr title="Ein regulรคrer Ausdruck, auch regex oder regexp g
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/query_params_str_validations/tutorial004_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial004_an.py!}
``` ```
//// ////
@ -364,7 +364,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial004_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial004_py310.py!}
``` ```
//// ////
@ -378,7 +378,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial004.py!} {!> ../../docs_src/query_params_str_validations/tutorial004.py!}
``` ```
//// ////
@ -402,7 +402,7 @@ Sie kรถnnten immer noch Code sehen, der den alten Namen verwendet:
//// tab | Python 3.10+ Pydantic v1 //// tab | Python 3.10+ Pydantic v1
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial004_an_py310_regex.py!} {!> ../../docs_src/query_params_str_validations/tutorial004_an_py310_regex.py!}
``` ```
//// ////
@ -418,7 +418,7 @@ Beispielsweise kรถnnten Sie den `q` Query-Parameter so deklarieren, dass er eine
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial005_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial005_an_py39.py!}
``` ```
//// ////
@ -426,7 +426,7 @@ Beispielsweise kรถnnten Sie den `q` Query-Parameter so deklarieren, dass er eine
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/query_params_str_validations/tutorial005_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial005_an.py!}
``` ```
//// ////
@ -440,7 +440,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial005.py!} {!> ../../docs_src/query_params_str_validations/tutorial005.py!}
``` ```
//// ////
@ -488,7 +488,7 @@ Wenn Sie einen Parameter erforderlich machen wollen, wรคhrend Sie `Query` verwen
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial006_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial006_an_py39.py!}
``` ```
//// ////
@ -496,7 +496,7 @@ Wenn Sie einen Parameter erforderlich machen wollen, wรคhrend Sie `Query` verwen
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/query_params_str_validations/tutorial006_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial006_an.py!}
``` ```
//// ////
@ -510,7 +510,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial006.py!} {!> ../../docs_src/query_params_str_validations/tutorial006.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -530,7 +530,7 @@ Es gibt eine Alternative, die explizit deklariert, dass ein Wert erforderlich is
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial006b_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial006b_an_py39.py!}
``` ```
//// ////
@ -538,7 +538,7 @@ Es gibt eine Alternative, die explizit deklariert, dass ein Wert erforderlich is
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/query_params_str_validations/tutorial006b_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial006b_an.py!}
``` ```
//// ////
@ -552,7 +552,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial006b.py!} {!> ../../docs_src/query_params_str_validations/tutorial006b.py!}
``` ```
//// ////
@ -576,7 +576,7 @@ Um das zu machen, deklarieren Sie, dass `None` ein gรผltiger Typ ist, aber verwe
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial006c_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial006c_an_py310.py!}
``` ```
//// ////
@ -584,7 +584,7 @@ Um das zu machen, deklarieren Sie, dass `None` ein gรผltiger Typ ist, aber verwe
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial006c_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial006c_an_py39.py!}
``` ```
//// ////
@ -592,7 +592,7 @@ Um das zu machen, deklarieren Sie, dass `None` ein gรผltiger Typ ist, aber verwe
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial006c_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial006c_an.py!}
``` ```
//// ////
@ -606,7 +606,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial006c_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial006c_py310.py!}
``` ```
//// ////
@ -620,7 +620,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial006c.py!} {!> ../../docs_src/query_params_str_validations/tutorial006c.py!}
``` ```
//// ////
@ -646,7 +646,7 @@ Um zum Beispiel einen Query-Parameter `q` zu deklarieren, der mehrere Male in de
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial011_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial011_an_py310.py!}
``` ```
//// ////
@ -654,7 +654,7 @@ Um zum Beispiel einen Query-Parameter `q` zu deklarieren, der mehrere Male in de
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial011_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial011_an_py39.py!}
``` ```
//// ////
@ -662,7 +662,7 @@ Um zum Beispiel einen Query-Parameter `q` zu deklarieren, der mehrere Male in de
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial011_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial011_an.py!}
``` ```
//// ////
@ -676,7 +676,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial011_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial011_py310.py!}
``` ```
//// ////
@ -690,7 +690,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial011_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial011_py39.py!}
``` ```
//// ////
@ -704,7 +704,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial011.py!} {!> ../../docs_src/query_params_str_validations/tutorial011.py!}
``` ```
//// ////
@ -745,7 +745,7 @@ Und Sie kรถnnen auch eine Default-`list`e von Werten definieren, wenn keine รผbe
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial012_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial012_an_py39.py!}
``` ```
//// ////
@ -753,7 +753,7 @@ Und Sie kรถnnen auch eine Default-`list`e von Werten definieren, wenn keine รผbe
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial012_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial012_an.py!}
``` ```
//// ////
@ -767,7 +767,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial012_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial012_py39.py!}
``` ```
//// ////
@ -781,7 +781,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial012.py!} {!> ../../docs_src/query_params_str_validations/tutorial012.py!}
``` ```
//// ////
@ -810,7 +810,7 @@ Sie kรถnnen auch `list` direkt verwenden, anstelle von `List[str]` (oder `list[s
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial013_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial013_an_py39.py!}
``` ```
//// ////
@ -818,7 +818,7 @@ Sie kรถnnen auch `list` direkt verwenden, anstelle von `List[str]` (oder `list[s
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/query_params_str_validations/tutorial013_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial013_an.py!}
``` ```
//// ////
@ -832,7 +832,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial013.py!} {!> ../../docs_src/query_params_str_validations/tutorial013.py!}
``` ```
//// ////
@ -864,7 +864,7 @@ Sie kรถnnen einen Titel hinzufรผgen โ€“ `title`:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial007_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial007_an_py310.py!}
``` ```
//// ////
@ -872,7 +872,7 @@ Sie kรถnnen einen Titel hinzufรผgen โ€“ `title`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial007_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial007_an_py39.py!}
``` ```
//// ////
@ -880,7 +880,7 @@ Sie kรถnnen einen Titel hinzufรผgen โ€“ `title`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial007_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial007_an.py!}
``` ```
//// ////
@ -894,7 +894,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/query_params_str_validations/tutorial007_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial007_py310.py!}
``` ```
//// ////
@ -908,7 +908,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial007.py!} {!> ../../docs_src/query_params_str_validations/tutorial007.py!}
``` ```
//// ////
@ -918,7 +918,7 @@ Und eine Beschreibung โ€“ `description`:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="14" ```Python hl_lines="14"
{!> ../../../docs_src/query_params_str_validations/tutorial008_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial008_an_py310.py!}
``` ```
//// ////
@ -926,7 +926,7 @@ Und eine Beschreibung โ€“ `description`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="14" ```Python hl_lines="14"
{!> ../../../docs_src/query_params_str_validations/tutorial008_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial008_an_py39.py!}
``` ```
//// ////
@ -934,7 +934,7 @@ Und eine Beschreibung โ€“ `description`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="15" ```Python hl_lines="15"
{!> ../../../docs_src/query_params_str_validations/tutorial008_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial008_an.py!}
``` ```
//// ////
@ -948,7 +948,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial008_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial008_py310.py!}
``` ```
//// ////
@ -962,7 +962,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="13" ```Python hl_lines="13"
{!> ../../../docs_src/query_params_str_validations/tutorial008.py!} {!> ../../docs_src/query_params_str_validations/tutorial008.py!}
``` ```
//// ////
@ -988,7 +988,7 @@ Dann kรถnnen Sie einen `alias` deklarieren, und dieser Alias wird verwendet, um
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial009_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial009_an_py310.py!}
``` ```
//// ////
@ -996,7 +996,7 @@ Dann kรถnnen Sie einen `alias` deklarieren, und dieser Alias wird verwendet, um
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial009_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial009_an_py39.py!}
``` ```
//// ////
@ -1004,7 +1004,7 @@ Dann kรถnnen Sie einen `alias` deklarieren, und dieser Alias wird verwendet, um
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial009_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial009_an.py!}
``` ```
//// ////
@ -1018,7 +1018,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params_str_validations/tutorial009_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial009_py310.py!}
``` ```
//// ////
@ -1032,7 +1032,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params_str_validations/tutorial009.py!} {!> ../../docs_src/query_params_str_validations/tutorial009.py!}
``` ```
//// ////
@ -1048,7 +1048,7 @@ In diesem Fall fรผgen Sie den Parameter `deprecated=True` zu `Query` hinzu.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/query_params_str_validations/tutorial010_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial010_an_py310.py!}
``` ```
//// ////
@ -1056,7 +1056,7 @@ In diesem Fall fรผgen Sie den Parameter `deprecated=True` zu `Query` hinzu.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="19" ```Python hl_lines="19"
{!> ../../../docs_src/query_params_str_validations/tutorial010_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial010_an_py39.py!}
``` ```
//// ////
@ -1064,7 +1064,7 @@ In diesem Fall fรผgen Sie den Parameter `deprecated=True` zu `Query` hinzu.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="20" ```Python hl_lines="20"
{!> ../../../docs_src/query_params_str_validations/tutorial010_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial010_an.py!}
``` ```
//// ////
@ -1078,7 +1078,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="16" ```Python hl_lines="16"
{!> ../../../docs_src/query_params_str_validations/tutorial010_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial010_py310.py!}
``` ```
//// ////
@ -1092,7 +1092,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/query_params_str_validations/tutorial010.py!} {!> ../../docs_src/query_params_str_validations/tutorial010.py!}
``` ```
//// ////
@ -1108,7 +1108,7 @@ Um einen Query-Parameter vom generierten OpenAPI-Schema auszuschlieรŸen (und dah
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial014_an_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial014_an_py310.py!}
``` ```
//// ////
@ -1116,7 +1116,7 @@ Um einen Query-Parameter vom generierten OpenAPI-Schema auszuschlieรŸen (und dah
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial014_an_py39.py!} {!> ../../docs_src/query_params_str_validations/tutorial014_an_py39.py!}
``` ```
//// ////
@ -1124,7 +1124,7 @@ Um einen Query-Parameter vom generierten OpenAPI-Schema auszuschlieรŸen (und dah
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/query_params_str_validations/tutorial014_an.py!} {!> ../../docs_src/query_params_str_validations/tutorial014_an.py!}
``` ```
//// ////
@ -1138,7 +1138,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/query_params_str_validations/tutorial014_py310.py!} {!> ../../docs_src/query_params_str_validations/tutorial014_py310.py!}
``` ```
//// ////
@ -1152,7 +1152,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params_str_validations/tutorial014.py!} {!> ../../docs_src/query_params_str_validations/tutorial014.py!}
``` ```
//// ////

20
docs/de/docs/tutorial/query-params.md

@ -3,7 +3,7 @@
Wenn Sie in ihrer Funktion Parameter deklarieren, die nicht Teil der Pfad-Parameter sind, dann werden diese automatisch als โ€žQueryโ€œ-Parameter interpretiert. Wenn Sie in ihrer Funktion Parameter deklarieren, die nicht Teil der Pfad-Parameter sind, dann werden diese automatisch als โ€žQueryโ€œ-Parameter interpretiert.
```Python hl_lines="9" ```Python hl_lines="9"
{!../../../docs_src/query_params/tutorial001.py!} {!../../docs_src/query_params/tutorial001.py!}
``` ```
Query-Parameter (Deutsch: Abfrage-Parameter) sind die Schlรผssel-Wert-Paare, die nach dem `?` in einer URL aufgelistet sind, getrennt durch `&`-Zeichen. Query-Parameter (Deutsch: Abfrage-Parameter) sind die Schlรผssel-Wert-Paare, die nach dem `?` in einer URL aufgelistet sind, getrennt durch `&`-Zeichen.
@ -66,7 +66,7 @@ Auf die gleiche Weise kรถnnen Sie optionale Query-Parameter deklarieren, indem S
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params/tutorial002_py310.py!} {!> ../../docs_src/query_params/tutorial002_py310.py!}
``` ```
//// ////
@ -74,7 +74,7 @@ Auf die gleiche Weise kรถnnen Sie optionale Query-Parameter deklarieren, indem S
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params/tutorial002.py!} {!> ../../docs_src/query_params/tutorial002.py!}
``` ```
//// ////
@ -94,7 +94,7 @@ Sie kรถnnen auch `bool`-Typen deklarieren und sie werden konvertiert:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/query_params/tutorial003_py310.py!} {!> ../../docs_src/query_params/tutorial003_py310.py!}
``` ```
//// ////
@ -102,7 +102,7 @@ Sie kรถnnen auch `bool`-Typen deklarieren und sie werden konvertiert:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/query_params/tutorial003.py!} {!> ../../docs_src/query_params/tutorial003.py!}
``` ```
//// ////
@ -150,7 +150,7 @@ Parameter werden anhand ihres Namens erkannt:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="6 8" ```Python hl_lines="6 8"
{!> ../../../docs_src/query_params/tutorial004_py310.py!} {!> ../../docs_src/query_params/tutorial004_py310.py!}
``` ```
//// ////
@ -158,7 +158,7 @@ Parameter werden anhand ihres Namens erkannt:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8 10" ```Python hl_lines="8 10"
{!> ../../../docs_src/query_params/tutorial004.py!} {!> ../../docs_src/query_params/tutorial004.py!}
``` ```
//// ////
@ -172,7 +172,7 @@ Wenn Sie keinen spezifischen Wert haben wollen, sondern der Parameter einfach op
Aber wenn Sie wollen, dass ein Query-Parameter erforderlich ist, vergeben Sie einfach keinen Defaultwert: Aber wenn Sie wollen, dass ein Query-Parameter erforderlich ist, vergeben Sie einfach keinen Defaultwert:
```Python hl_lines="6-7" ```Python hl_lines="6-7"
{!../../../docs_src/query_params/tutorial005.py!} {!../../docs_src/query_params/tutorial005.py!}
``` ```
Hier ist `needy` ein erforderlicher Query-Parameter vom Typ `str`. Hier ist `needy` ein erforderlicher Query-Parameter vom Typ `str`.
@ -222,7 +222,7 @@ Und natรผrlich kรถnnen Sie einige Parameter als erforderlich, einige mit Default
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/query_params/tutorial006_py310.py!} {!> ../../docs_src/query_params/tutorial006_py310.py!}
``` ```
//// ////
@ -230,7 +230,7 @@ Und natรผrlich kรถnnen Sie einige Parameter als erforderlich, einige mit Default
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/query_params/tutorial006.py!} {!> ../../docs_src/query_params/tutorial006.py!}
``` ```
//// ////

50
docs/de/docs/tutorial/request-files.md

@ -19,7 +19,7 @@ Importieren Sie `File` und `UploadFile` von `fastapi`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/request_files/tutorial001_an_py39.py!} {!> ../../docs_src/request_files/tutorial001_an_py39.py!}
``` ```
//// ////
@ -27,7 +27,7 @@ Importieren Sie `File` und `UploadFile` von `fastapi`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/request_files/tutorial001_an.py!} {!> ../../docs_src/request_files/tutorial001_an.py!}
``` ```
//// ////
@ -41,7 +41,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/request_files/tutorial001.py!} {!> ../../docs_src/request_files/tutorial001.py!}
``` ```
//// ////
@ -53,7 +53,7 @@ Erstellen Sie Datei-Parameter, so wie Sie es auch mit `Body` und `Form` machen w
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/request_files/tutorial001_an_py39.py!} {!> ../../docs_src/request_files/tutorial001_an_py39.py!}
``` ```
//// ////
@ -61,7 +61,7 @@ Erstellen Sie Datei-Parameter, so wie Sie es auch mit `Body` und `Form` machen w
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/request_files/tutorial001_an.py!} {!> ../../docs_src/request_files/tutorial001_an.py!}
``` ```
//// ////
@ -75,7 +75,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/request_files/tutorial001.py!} {!> ../../docs_src/request_files/tutorial001.py!}
``` ```
//// ////
@ -109,7 +109,7 @@ Definieren Sie einen Datei-Parameter mit dem Typ `UploadFile`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="14" ```Python hl_lines="14"
{!> ../../../docs_src/request_files/tutorial001_an_py39.py!} {!> ../../docs_src/request_files/tutorial001_an_py39.py!}
``` ```
//// ////
@ -117,7 +117,7 @@ Definieren Sie einen Datei-Parameter mit dem Typ `UploadFile`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="13" ```Python hl_lines="13"
{!> ../../../docs_src/request_files/tutorial001_an.py!} {!> ../../docs_src/request_files/tutorial001_an.py!}
``` ```
//// ////
@ -131,7 +131,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/request_files/tutorial001.py!} {!> ../../docs_src/request_files/tutorial001.py!}
``` ```
//// ////
@ -220,7 +220,7 @@ Sie kรถnnen eine Datei optional machen, indem Sie Standard-Typannotationen verwe
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9 17" ```Python hl_lines="9 17"
{!> ../../../docs_src/request_files/tutorial001_02_an_py310.py!} {!> ../../docs_src/request_files/tutorial001_02_an_py310.py!}
``` ```
//// ////
@ -228,7 +228,7 @@ Sie kรถnnen eine Datei optional machen, indem Sie Standard-Typannotationen verwe
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9 17" ```Python hl_lines="9 17"
{!> ../../../docs_src/request_files/tutorial001_02_an_py39.py!} {!> ../../docs_src/request_files/tutorial001_02_an_py39.py!}
``` ```
//// ////
@ -236,7 +236,7 @@ Sie kรถnnen eine Datei optional machen, indem Sie Standard-Typannotationen verwe
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10 18" ```Python hl_lines="10 18"
{!> ../../../docs_src/request_files/tutorial001_02_an.py!} {!> ../../docs_src/request_files/tutorial001_02_an.py!}
``` ```
//// ////
@ -250,7 +250,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7 15" ```Python hl_lines="7 15"
{!> ../../../docs_src/request_files/tutorial001_02_py310.py!} {!> ../../docs_src/request_files/tutorial001_02_py310.py!}
``` ```
//// ////
@ -264,7 +264,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9 17" ```Python hl_lines="9 17"
{!> ../../../docs_src/request_files/tutorial001_02.py!} {!> ../../docs_src/request_files/tutorial001_02.py!}
``` ```
//// ////
@ -276,7 +276,7 @@ Sie kรถnnen auch `File()` zusammen mit `UploadFile` verwenden, um zum Beispiel z
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9 15" ```Python hl_lines="9 15"
{!> ../../../docs_src/request_files/tutorial001_03_an_py39.py!} {!> ../../docs_src/request_files/tutorial001_03_an_py39.py!}
``` ```
//// ////
@ -284,7 +284,7 @@ Sie kรถnnen auch `File()` zusammen mit `UploadFile` verwenden, um zum Beispiel z
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8 14" ```Python hl_lines="8 14"
{!> ../../../docs_src/request_files/tutorial001_03_an.py!} {!> ../../docs_src/request_files/tutorial001_03_an.py!}
``` ```
//// ////
@ -298,7 +298,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7 13" ```Python hl_lines="7 13"
{!> ../../../docs_src/request_files/tutorial001_03.py!} {!> ../../docs_src/request_files/tutorial001_03.py!}
``` ```
//// ////
@ -314,7 +314,7 @@ Um das zu machen, deklarieren Sie eine Liste von `bytes` oder `UploadFile`s:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10 15" ```Python hl_lines="10 15"
{!> ../../../docs_src/request_files/tutorial002_an_py39.py!} {!> ../../docs_src/request_files/tutorial002_an_py39.py!}
``` ```
//// ////
@ -322,7 +322,7 @@ Um das zu machen, deklarieren Sie eine Liste von `bytes` oder `UploadFile`s:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="11 16" ```Python hl_lines="11 16"
{!> ../../../docs_src/request_files/tutorial002_an.py!} {!> ../../docs_src/request_files/tutorial002_an.py!}
``` ```
//// ////
@ -336,7 +336,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8 13" ```Python hl_lines="8 13"
{!> ../../../docs_src/request_files/tutorial002_py39.py!} {!> ../../docs_src/request_files/tutorial002_py39.py!}
``` ```
//// ////
@ -350,7 +350,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10 15" ```Python hl_lines="10 15"
{!> ../../../docs_src/request_files/tutorial002.py!} {!> ../../docs_src/request_files/tutorial002.py!}
``` ```
//// ////
@ -372,7 +372,7 @@ Und so wie zuvor kรถnnen Sie `File()` verwenden, um zusรคtzliche Parameter zu se
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="11 18-20" ```Python hl_lines="11 18-20"
{!> ../../../docs_src/request_files/tutorial003_an_py39.py!} {!> ../../docs_src/request_files/tutorial003_an_py39.py!}
``` ```
//// ////
@ -380,7 +380,7 @@ Und so wie zuvor kรถnnen Sie `File()` verwenden, um zusรคtzliche Parameter zu se
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="12 19-21" ```Python hl_lines="12 19-21"
{!> ../../../docs_src/request_files/tutorial003_an.py!} {!> ../../docs_src/request_files/tutorial003_an.py!}
``` ```
//// ////
@ -394,7 +394,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="9 16" ```Python hl_lines="9 16"
{!> ../../../docs_src/request_files/tutorial003_py39.py!} {!> ../../docs_src/request_files/tutorial003_py39.py!}
``` ```
//// ////
@ -408,7 +408,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="11 18" ```Python hl_lines="11 18"
{!> ../../../docs_src/request_files/tutorial003.py!} {!> ../../docs_src/request_files/tutorial003.py!}
``` ```
//// ////

12
docs/de/docs/tutorial/request-forms-and-files.md

@ -15,7 +15,7 @@ Z. B. `pip install python-multipart`.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/request_forms_and_files/tutorial001_an_py39.py!} {!> ../../docs_src/request_forms_and_files/tutorial001_an_py39.py!}
``` ```
//// ////
@ -23,7 +23,7 @@ Z. B. `pip install python-multipart`.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/request_forms_and_files/tutorial001_an.py!} {!> ../../docs_src/request_forms_and_files/tutorial001_an.py!}
``` ```
//// ////
@ -37,7 +37,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/request_forms_and_files/tutorial001.py!} {!> ../../docs_src/request_forms_and_files/tutorial001.py!}
``` ```
//// ////
@ -49,7 +49,7 @@ Erstellen Sie Datei- und Formularparameter, so wie Sie es auch mit `Body` und `Q
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="10-12" ```Python hl_lines="10-12"
{!> ../../../docs_src/request_forms_and_files/tutorial001_an_py39.py!} {!> ../../docs_src/request_forms_and_files/tutorial001_an_py39.py!}
``` ```
//// ////
@ -57,7 +57,7 @@ Erstellen Sie Datei- und Formularparameter, so wie Sie es auch mit `Body` und `Q
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9-11" ```Python hl_lines="9-11"
{!> ../../../docs_src/request_forms_and_files/tutorial001_an.py!} {!> ../../docs_src/request_forms_and_files/tutorial001_an.py!}
``` ```
//// ////
@ -71,7 +71,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/request_forms_and_files/tutorial001.py!} {!> ../../docs_src/request_forms_and_files/tutorial001.py!}
``` ```
//// ////

12
docs/de/docs/tutorial/request-forms.md

@ -17,7 +17,7 @@ Importieren Sie `Form` von `fastapi`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="3" ```Python hl_lines="3"
{!> ../../../docs_src/request_forms/tutorial001_an_py39.py!} {!> ../../docs_src/request_forms/tutorial001_an_py39.py!}
``` ```
//// ////
@ -25,7 +25,7 @@ Importieren Sie `Form` von `fastapi`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/request_forms/tutorial001_an.py!} {!> ../../docs_src/request_forms/tutorial001_an.py!}
``` ```
//// ////
@ -39,7 +39,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1" ```Python hl_lines="1"
{!> ../../../docs_src/request_forms/tutorial001.py!} {!> ../../docs_src/request_forms/tutorial001.py!}
``` ```
//// ////
@ -51,7 +51,7 @@ Erstellen Sie Formular-Parameter, so wie Sie es auch mit `Body` und `Query` mach
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/request_forms/tutorial001_an_py39.py!} {!> ../../docs_src/request_forms/tutorial001_an_py39.py!}
``` ```
//// ////
@ -59,7 +59,7 @@ Erstellen Sie Formular-Parameter, so wie Sie es auch mit `Body` und `Query` mach
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/request_forms/tutorial001_an.py!} {!> ../../docs_src/request_forms/tutorial001_an.py!}
``` ```
//// ////
@ -73,7 +73,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/request_forms/tutorial001.py!} {!> ../../docs_src/request_forms/tutorial001.py!}
``` ```
//// ////

68
docs/de/docs/tutorial/response-model.md

@ -7,7 +7,7 @@ Hierbei kรถnnen Sie **Typannotationen** genauso verwenden, wie Sie es bei Werten
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="16 21" ```Python hl_lines="16 21"
{!> ../../../docs_src/response_model/tutorial001_01_py310.py!} {!> ../../docs_src/response_model/tutorial001_01_py310.py!}
``` ```
//// ////
@ -15,7 +15,7 @@ Hierbei kรถnnen Sie **Typannotationen** genauso verwenden, wie Sie es bei Werten
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="18 23" ```Python hl_lines="18 23"
{!> ../../../docs_src/response_model/tutorial001_01_py39.py!} {!> ../../docs_src/response_model/tutorial001_01_py39.py!}
``` ```
//// ////
@ -23,7 +23,7 @@ Hierbei kรถnnen Sie **Typannotationen** genauso verwenden, wie Sie es bei Werten
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="18 23" ```Python hl_lines="18 23"
{!> ../../../docs_src/response_model/tutorial001_01.py!} {!> ../../docs_src/response_model/tutorial001_01.py!}
``` ```
//// ////
@ -62,7 +62,7 @@ Sie kรถnnen `response_model` in jeder mรถglichen *Pfadoperation* verwenden:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="17 22 24-27" ```Python hl_lines="17 22 24-27"
{!> ../../../docs_src/response_model/tutorial001_py310.py!} {!> ../../docs_src/response_model/tutorial001_py310.py!}
``` ```
//// ////
@ -70,7 +70,7 @@ Sie kรถnnen `response_model` in jeder mรถglichen *Pfadoperation* verwenden:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="17 22 24-27" ```Python hl_lines="17 22 24-27"
{!> ../../../docs_src/response_model/tutorial001_py39.py!} {!> ../../docs_src/response_model/tutorial001_py39.py!}
``` ```
//// ////
@ -78,7 +78,7 @@ Sie kรถnnen `response_model` in jeder mรถglichen *Pfadoperation* verwenden:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="17 22 24-27" ```Python hl_lines="17 22 24-27"
{!> ../../../docs_src/response_model/tutorial001.py!} {!> ../../docs_src/response_model/tutorial001.py!}
``` ```
//// ////
@ -116,7 +116,7 @@ Im Folgenden deklarieren wir ein `UserIn`-Modell; es enthรคlt ein Klartext-Passw
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7 9" ```Python hl_lines="7 9"
{!> ../../../docs_src/response_model/tutorial002_py310.py!} {!> ../../docs_src/response_model/tutorial002_py310.py!}
``` ```
//// ////
@ -124,7 +124,7 @@ Im Folgenden deklarieren wir ein `UserIn`-Modell; es enthรคlt ein Klartext-Passw
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9 11" ```Python hl_lines="9 11"
{!> ../../../docs_src/response_model/tutorial002.py!} {!> ../../docs_src/response_model/tutorial002.py!}
``` ```
//// ////
@ -143,7 +143,7 @@ Wir verwenden dieses Modell, um sowohl unsere Eingabe- als auch Ausgabedaten zu
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="16" ```Python hl_lines="16"
{!> ../../../docs_src/response_model/tutorial002_py310.py!} {!> ../../docs_src/response_model/tutorial002_py310.py!}
``` ```
//// ////
@ -151,7 +151,7 @@ Wir verwenden dieses Modell, um sowohl unsere Eingabe- als auch Ausgabedaten zu
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="18" ```Python hl_lines="18"
{!> ../../../docs_src/response_model/tutorial002.py!} {!> ../../docs_src/response_model/tutorial002.py!}
``` ```
//// ////
@ -175,7 +175,7 @@ Wir kรถnnen stattdessen ein Eingabemodell mit dem Klartext-Passwort, und ein Aus
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9 11 16" ```Python hl_lines="9 11 16"
{!> ../../../docs_src/response_model/tutorial003_py310.py!} {!> ../../docs_src/response_model/tutorial003_py310.py!}
``` ```
//// ////
@ -183,7 +183,7 @@ Wir kรถnnen stattdessen ein Eingabemodell mit dem Klartext-Passwort, und ein Aus
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9 11 16" ```Python hl_lines="9 11 16"
{!> ../../../docs_src/response_model/tutorial003.py!} {!> ../../docs_src/response_model/tutorial003.py!}
``` ```
//// ////
@ -193,7 +193,7 @@ Obwohl unsere *Pfadoperation-Funktion* hier denselben `user` von der Eingabe zur
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="24" ```Python hl_lines="24"
{!> ../../../docs_src/response_model/tutorial003_py310.py!} {!> ../../docs_src/response_model/tutorial003_py310.py!}
``` ```
//// ////
@ -201,7 +201,7 @@ Obwohl unsere *Pfadoperation-Funktion* hier denselben `user` von der Eingabe zur
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="24" ```Python hl_lines="24"
{!> ../../../docs_src/response_model/tutorial003.py!} {!> ../../docs_src/response_model/tutorial003.py!}
``` ```
//// ////
@ -211,7 +211,7 @@ Obwohl unsere *Pfadoperation-Funktion* hier denselben `user` von der Eingabe zur
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="22" ```Python hl_lines="22"
{!> ../../../docs_src/response_model/tutorial003_py310.py!} {!> ../../docs_src/response_model/tutorial003_py310.py!}
``` ```
//// ////
@ -219,7 +219,7 @@ Obwohl unsere *Pfadoperation-Funktion* hier denselben `user` von der Eingabe zur
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="22" ```Python hl_lines="22"
{!> ../../../docs_src/response_model/tutorial003.py!} {!> ../../docs_src/response_model/tutorial003.py!}
``` ```
//// ////
@ -249,7 +249,7 @@ Und in solchen Fรคllen kรถnnen wir Klassen und Vererbung verwenden, um Vorteil a
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7-10 13-14 18" ```Python hl_lines="7-10 13-14 18"
{!> ../../../docs_src/response_model/tutorial003_01_py310.py!} {!> ../../docs_src/response_model/tutorial003_01_py310.py!}
``` ```
//// ////
@ -257,7 +257,7 @@ Und in solchen Fรคllen kรถnnen wir Klassen und Vererbung verwenden, um Vorteil a
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9-13 15-16 20" ```Python hl_lines="9-13 15-16 20"
{!> ../../../docs_src/response_model/tutorial003_01.py!} {!> ../../docs_src/response_model/tutorial003_01.py!}
``` ```
//// ////
@ -303,7 +303,7 @@ Es kann Fรคlle geben, bei denen Sie etwas zurรผckgeben, das kein gรผltiges Pydan
Der hรคufigste Anwendungsfall ist, wenn Sie [eine Response direkt zurรผckgeben, wie es spรคter im Handbuch fรผr fortgeschrittene Benutzer erlรคutert wird](../advanced/response-directly.md){.internal-link target=_blank}. Der hรคufigste Anwendungsfall ist, wenn Sie [eine Response direkt zurรผckgeben, wie es spรคter im Handbuch fรผr fortgeschrittene Benutzer erlรคutert wird](../advanced/response-directly.md){.internal-link target=_blank}.
```Python hl_lines="8 10-11" ```Python hl_lines="8 10-11"
{!> ../../../docs_src/response_model/tutorial003_02.py!} {!> ../../docs_src/response_model/tutorial003_02.py!}
``` ```
Dieser einfache Anwendungsfall wird automatisch von FastAPI gehandhabt, weil die Annotation des Rรผckgabetyps die Klasse (oder eine Unterklasse von) `Response` ist. Dieser einfache Anwendungsfall wird automatisch von FastAPI gehandhabt, weil die Annotation des Rรผckgabetyps die Klasse (oder eine Unterklasse von) `Response` ist.
@ -315,7 +315,7 @@ Und Tools werden auch glรผcklich sein, weil sowohl `RedirectResponse` als auch `
Sie kรถnnen auch eine Unterklasse von `Response` in der Typannotation verwenden. Sie kรถnnen auch eine Unterklasse von `Response` in der Typannotation verwenden.
```Python hl_lines="8-9" ```Python hl_lines="8-9"
{!> ../../../docs_src/response_model/tutorial003_03.py!} {!> ../../docs_src/response_model/tutorial003_03.py!}
``` ```
Das wird ebenfalls funktionieren, weil `RedirectResponse` eine Unterklasse von `Response` ist, und FastAPI sich um diesen einfachen Anwendungsfall automatisch kรผmmert. Das wird ebenfalls funktionieren, weil `RedirectResponse` eine Unterklasse von `Response` ist, und FastAPI sich um diesen einfachen Anwendungsfall automatisch kรผmmert.
@ -329,7 +329,7 @@ Das gleiche wird passieren, wenn Sie eine <abbr title='Eine Union mehrerer Typen
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/response_model/tutorial003_04_py310.py!} {!> ../../docs_src/response_model/tutorial003_04_py310.py!}
``` ```
//// ////
@ -337,7 +337,7 @@ Das gleiche wird passieren, wenn Sie eine <abbr title='Eine Union mehrerer Typen
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/response_model/tutorial003_04.py!} {!> ../../docs_src/response_model/tutorial003_04.py!}
``` ```
//// ////
@ -355,7 +355,7 @@ In diesem Fall kรถnnen Sie die Generierung des Responsemodells abschalten, indem
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/response_model/tutorial003_05_py310.py!} {!> ../../docs_src/response_model/tutorial003_05_py310.py!}
``` ```
//// ////
@ -363,7 +363,7 @@ In diesem Fall kรถnnen Sie die Generierung des Responsemodells abschalten, indem
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="9" ```Python hl_lines="9"
{!> ../../../docs_src/response_model/tutorial003_05.py!} {!> ../../docs_src/response_model/tutorial003_05.py!}
``` ```
//// ////
@ -377,7 +377,7 @@ Ihr Responsemodell kรถnnte Defaultwerte haben, wie:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="9 11-12" ```Python hl_lines="9 11-12"
{!> ../../../docs_src/response_model/tutorial004_py310.py!} {!> ../../docs_src/response_model/tutorial004_py310.py!}
``` ```
//// ////
@ -385,7 +385,7 @@ Ihr Responsemodell kรถnnte Defaultwerte haben, wie:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="11 13-14" ```Python hl_lines="11 13-14"
{!> ../../../docs_src/response_model/tutorial004_py39.py!} {!> ../../docs_src/response_model/tutorial004_py39.py!}
``` ```
//// ////
@ -393,7 +393,7 @@ Ihr Responsemodell kรถnnte Defaultwerte haben, wie:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="11 13-14" ```Python hl_lines="11 13-14"
{!> ../../../docs_src/response_model/tutorial004.py!} {!> ../../docs_src/response_model/tutorial004.py!}
``` ```
//// ////
@ -413,7 +413,7 @@ Sie kรถnnen den *Pfadoperation-Dekorator*-Parameter `response_model_exclude_unse
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="22" ```Python hl_lines="22"
{!> ../../../docs_src/response_model/tutorial004_py310.py!} {!> ../../docs_src/response_model/tutorial004_py310.py!}
``` ```
//// ////
@ -421,7 +421,7 @@ Sie kรถnnen den *Pfadoperation-Dekorator*-Parameter `response_model_exclude_unse
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="24" ```Python hl_lines="24"
{!> ../../../docs_src/response_model/tutorial004_py39.py!} {!> ../../docs_src/response_model/tutorial004_py39.py!}
``` ```
//// ////
@ -429,7 +429,7 @@ Sie kรถnnen den *Pfadoperation-Dekorator*-Parameter `response_model_exclude_unse
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="24" ```Python hl_lines="24"
{!> ../../../docs_src/response_model/tutorial004.py!} {!> ../../docs_src/response_model/tutorial004.py!}
``` ```
//// ////
@ -532,7 +532,7 @@ Das trifft auch auf `response_model_by_alias` zu, welches รคhnlich funktioniert.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="29 35" ```Python hl_lines="29 35"
{!> ../../../docs_src/response_model/tutorial005_py310.py!} {!> ../../docs_src/response_model/tutorial005_py310.py!}
``` ```
//// ////
@ -540,7 +540,7 @@ Das trifft auch auf `response_model_by_alias` zu, welches รคhnlich funktioniert.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="31 37" ```Python hl_lines="31 37"
{!> ../../../docs_src/response_model/tutorial005.py!} {!> ../../docs_src/response_model/tutorial005.py!}
``` ```
//// ////
@ -560,7 +560,7 @@ Wenn Sie vergessen, ein `set` zu verwenden, und stattdessen eine `list`e oder ei
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="29 35" ```Python hl_lines="29 35"
{!> ../../../docs_src/response_model/tutorial006_py310.py!} {!> ../../docs_src/response_model/tutorial006_py310.py!}
``` ```
//// ////
@ -568,7 +568,7 @@ Wenn Sie vergessen, ein `set` zu verwenden, und stattdessen eine `list`e oder ei
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="31 37" ```Python hl_lines="31 37"
{!> ../../../docs_src/response_model/tutorial006.py!} {!> ../../docs_src/response_model/tutorial006.py!}
``` ```
//// ////

6
docs/de/docs/tutorial/response-status-code.md

@ -9,7 +9,7 @@ So wie ein Responsemodell, kรถnnen Sie auch einen HTTP-Statuscode fรผr die Respo
* usw. * usw.
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/response_status_code/tutorial001.py!} {!../../docs_src/response_status_code/tutorial001.py!}
``` ```
/// note | "Hinweis" /// note | "Hinweis"
@ -77,7 +77,7 @@ Um mehr รผber Statuscodes zu lernen, und welcher wofรผr verwendet wird, lesen Si
Schauen wir uns das vorherige Beispiel noch einmal an: Schauen wir uns das vorherige Beispiel noch einmal an:
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/response_status_code/tutorial001.py!} {!../../docs_src/response_status_code/tutorial001.py!}
``` ```
`201` ist der Statuscode fรผr โ€žCreatedโ€œ (โ€žErzeugtโ€œ). `201` ist der Statuscode fรผr โ€žCreatedโ€œ (โ€žErzeugtโ€œ).
@ -87,7 +87,7 @@ Aber Sie mรผssen sich nicht daran erinnern, welcher dieser Codes was bedeutet.
Sie kรถnnen die Hilfsvariablen von `fastapi.status` verwenden. Sie kรถnnen die Hilfsvariablen von `fastapi.status` verwenden.
```Python hl_lines="1 6" ```Python hl_lines="1 6"
{!../../../docs_src/response_status_code/tutorial002.py!} {!../../docs_src/response_status_code/tutorial002.py!}
``` ```
Diese sind nur eine Annehmlichkeit und enthalten dieselbe Nummer, aber auf diese Weise kรถnnen Sie die Autovervollstรคndigung Ihres Editors verwenden, um sie zu finden: Diese sind nur eine Annehmlichkeit und enthalten dieselbe Nummer, aber auf diese Weise kรถnnen Sie die Autovervollstรคndigung Ihres Editors verwenden, um sie zu finden:

42
docs/de/docs/tutorial/schema-extra-example.md

@ -11,7 +11,7 @@ Sie kรถnnen `examples` (โ€žBeispieleโ€œ) fรผr ein Pydantic-Modell deklarieren, w
//// tab | Python 3.10+ Pydantic v2 //// tab | Python 3.10+ Pydantic v2
```Python hl_lines="13-24" ```Python hl_lines="13-24"
{!> ../../../docs_src/schema_extra_example/tutorial001_py310.py!} {!> ../../docs_src/schema_extra_example/tutorial001_py310.py!}
``` ```
//// ////
@ -19,7 +19,7 @@ Sie kรถnnen `examples` (โ€žBeispieleโ€œ) fรผr ein Pydantic-Modell deklarieren, w
//// tab | Python 3.10+ Pydantic v1 //// tab | Python 3.10+ Pydantic v1
```Python hl_lines="13-23" ```Python hl_lines="13-23"
{!> ../../../docs_src/schema_extra_example/tutorial001_py310_pv1.py!} {!> ../../docs_src/schema_extra_example/tutorial001_py310_pv1.py!}
``` ```
//// ////
@ -27,7 +27,7 @@ Sie kรถnnen `examples` (โ€žBeispieleโ€œ) fรผr ein Pydantic-Modell deklarieren, w
//// tab | Python 3.8+ Pydantic v2 //// tab | Python 3.8+ Pydantic v2
```Python hl_lines="15-26" ```Python hl_lines="15-26"
{!> ../../../docs_src/schema_extra_example/tutorial001.py!} {!> ../../docs_src/schema_extra_example/tutorial001.py!}
``` ```
//// ////
@ -35,7 +35,7 @@ Sie kรถnnen `examples` (โ€žBeispieleโ€œ) fรผr ein Pydantic-Modell deklarieren, w
//// tab | Python 3.8+ Pydantic v1 //// tab | Python 3.8+ Pydantic v1
```Python hl_lines="15-25" ```Python hl_lines="15-25"
{!> ../../../docs_src/schema_extra_example/tutorial001_pv1.py!} {!> ../../docs_src/schema_extra_example/tutorial001_pv1.py!}
``` ```
//// ////
@ -83,7 +83,7 @@ Wenn Sie `Field()` mit Pydantic-Modellen verwenden, kรถnnen Sie ebenfalls zusรคt
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="2 8-11" ```Python hl_lines="2 8-11"
{!> ../../../docs_src/schema_extra_example/tutorial002_py310.py!} {!> ../../docs_src/schema_extra_example/tutorial002_py310.py!}
``` ```
//// ////
@ -91,7 +91,7 @@ Wenn Sie `Field()` mit Pydantic-Modellen verwenden, kรถnnen Sie ebenfalls zusรคt
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="4 10-13" ```Python hl_lines="4 10-13"
{!> ../../../docs_src/schema_extra_example/tutorial002.py!} {!> ../../docs_src/schema_extra_example/tutorial002.py!}
``` ```
//// ////
@ -117,7 +117,7 @@ Hier รผbergeben wir `examples`, welches ein einzelnes Beispiel fรผr die in `Body
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="22-29" ```Python hl_lines="22-29"
{!> ../../../docs_src/schema_extra_example/tutorial003_an_py310.py!} {!> ../../docs_src/schema_extra_example/tutorial003_an_py310.py!}
``` ```
//// ////
@ -125,7 +125,7 @@ Hier รผbergeben wir `examples`, welches ein einzelnes Beispiel fรผr die in `Body
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="22-29" ```Python hl_lines="22-29"
{!> ../../../docs_src/schema_extra_example/tutorial003_an_py39.py!} {!> ../../docs_src/schema_extra_example/tutorial003_an_py39.py!}
``` ```
//// ////
@ -133,7 +133,7 @@ Hier รผbergeben wir `examples`, welches ein einzelnes Beispiel fรผr die in `Body
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="23-30" ```Python hl_lines="23-30"
{!> ../../../docs_src/schema_extra_example/tutorial003_an.py!} {!> ../../docs_src/schema_extra_example/tutorial003_an.py!}
``` ```
//// ////
@ -147,7 +147,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="18-25" ```Python hl_lines="18-25"
{!> ../../../docs_src/schema_extra_example/tutorial003_py310.py!} {!> ../../docs_src/schema_extra_example/tutorial003_py310.py!}
``` ```
//// ////
@ -161,7 +161,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="20-27" ```Python hl_lines="20-27"
{!> ../../../docs_src/schema_extra_example/tutorial003.py!} {!> ../../docs_src/schema_extra_example/tutorial003.py!}
``` ```
//// ////
@ -179,7 +179,7 @@ Sie kรถnnen natรผrlich auch mehrere `examples` รผbergeben:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="23-38" ```Python hl_lines="23-38"
{!> ../../../docs_src/schema_extra_example/tutorial004_an_py310.py!} {!> ../../docs_src/schema_extra_example/tutorial004_an_py310.py!}
``` ```
//// ////
@ -187,7 +187,7 @@ Sie kรถnnen natรผrlich auch mehrere `examples` รผbergeben:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="23-38" ```Python hl_lines="23-38"
{!> ../../../docs_src/schema_extra_example/tutorial004_an_py39.py!} {!> ../../docs_src/schema_extra_example/tutorial004_an_py39.py!}
``` ```
//// ////
@ -195,7 +195,7 @@ Sie kรถnnen natรผrlich auch mehrere `examples` รผbergeben:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="24-39" ```Python hl_lines="24-39"
{!> ../../../docs_src/schema_extra_example/tutorial004_an.py!} {!> ../../docs_src/schema_extra_example/tutorial004_an.py!}
``` ```
//// ////
@ -209,7 +209,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="19-34" ```Python hl_lines="19-34"
{!> ../../../docs_src/schema_extra_example/tutorial004_py310.py!} {!> ../../docs_src/schema_extra_example/tutorial004_py310.py!}
``` ```
//// ////
@ -223,7 +223,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="21-36" ```Python hl_lines="21-36"
{!> ../../../docs_src/schema_extra_example/tutorial004.py!} {!> ../../docs_src/schema_extra_example/tutorial004.py!}
``` ```
//// ////
@ -270,7 +270,7 @@ Sie kรถnnen es so verwenden:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="23-49" ```Python hl_lines="23-49"
{!> ../../../docs_src/schema_extra_example/tutorial005_an_py310.py!} {!> ../../docs_src/schema_extra_example/tutorial005_an_py310.py!}
``` ```
//// ////
@ -278,7 +278,7 @@ Sie kรถnnen es so verwenden:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="23-49" ```Python hl_lines="23-49"
{!> ../../../docs_src/schema_extra_example/tutorial005_an_py39.py!} {!> ../../docs_src/schema_extra_example/tutorial005_an_py39.py!}
``` ```
//// ////
@ -286,7 +286,7 @@ Sie kรถnnen es so verwenden:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="24-50" ```Python hl_lines="24-50"
{!> ../../../docs_src/schema_extra_example/tutorial005_an.py!} {!> ../../docs_src/schema_extra_example/tutorial005_an.py!}
``` ```
//// ////
@ -300,7 +300,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="19-45" ```Python hl_lines="19-45"
{!> ../../../docs_src/schema_extra_example/tutorial005_py310.py!} {!> ../../docs_src/schema_extra_example/tutorial005_py310.py!}
``` ```
//// ////
@ -314,7 +314,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="21-47" ```Python hl_lines="21-47"
{!> ../../../docs_src/schema_extra_example/tutorial005.py!} {!> ../../docs_src/schema_extra_example/tutorial005.py!}
``` ```
//// ////

18
docs/de/docs/tutorial/security/first-steps.md

@ -23,7 +23,7 @@ Kopieren Sie das Beispiel in eine Datei `main.py`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python ```Python
{!> ../../../docs_src/security/tutorial001_an_py39.py!} {!> ../../docs_src/security/tutorial001_an_py39.py!}
``` ```
//// ////
@ -31,7 +31,7 @@ Kopieren Sie das Beispiel in eine Datei `main.py`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python ```Python
{!> ../../../docs_src/security/tutorial001_an.py!} {!> ../../docs_src/security/tutorial001_an.py!}
``` ```
//// ////
@ -45,7 +45,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python ```Python
{!> ../../../docs_src/security/tutorial001.py!} {!> ../../docs_src/security/tutorial001.py!}
``` ```
//// ////
@ -157,7 +157,7 @@ Wenn wir eine Instanz der Klasse `OAuth2PasswordBearer` erstellen, รผbergeben wi
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="8" ```Python hl_lines="8"
{!> ../../../docs_src/security/tutorial001_an_py39.py!} {!> ../../docs_src/security/tutorial001_an_py39.py!}
``` ```
//// ////
@ -165,7 +165,7 @@ Wenn wir eine Instanz der Klasse `OAuth2PasswordBearer` erstellen, รผbergeben wi
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="7" ```Python hl_lines="7"
{!> ../../../docs_src/security/tutorial001_an.py!} {!> ../../docs_src/security/tutorial001_an.py!}
``` ```
//// ////
@ -179,7 +179,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="6" ```Python hl_lines="6"
{!> ../../../docs_src/security/tutorial001.py!} {!> ../../docs_src/security/tutorial001.py!}
``` ```
//// ////
@ -223,7 +223,7 @@ Jetzt kรถnnen Sie dieses `oauth2_scheme` als Abhรคngigkeit `Depends` รผbergeben.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/security/tutorial001_an_py39.py!} {!> ../../docs_src/security/tutorial001_an_py39.py!}
``` ```
//// ////
@ -231,7 +231,7 @@ Jetzt kรถnnen Sie dieses `oauth2_scheme` als Abhรคngigkeit `Depends` รผbergeben.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/security/tutorial001_an.py!} {!> ../../docs_src/security/tutorial001_an.py!}
``` ```
//// ////
@ -245,7 +245,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/security/tutorial001.py!} {!> ../../docs_src/security/tutorial001.py!}
``` ```
//// ////

56
docs/de/docs/tutorial/security/get-current-user.md

@ -5,7 +5,7 @@ Im vorherigen Kapitel hat das Sicherheitssystem (das auf dem Dependency Injectio
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="12" ```Python hl_lines="12"
{!> ../../../docs_src/security/tutorial001_an_py39.py!} {!> ../../docs_src/security/tutorial001_an_py39.py!}
``` ```
//// ////
@ -13,7 +13,7 @@ Im vorherigen Kapitel hat das Sicherheitssystem (das auf dem Dependency Injectio
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="11" ```Python hl_lines="11"
{!> ../../../docs_src/security/tutorial001_an.py!} {!> ../../docs_src/security/tutorial001_an.py!}
``` ```
//// ////
@ -27,7 +27,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="10" ```Python hl_lines="10"
{!> ../../../docs_src/security/tutorial001.py!} {!> ../../docs_src/security/tutorial001.py!}
``` ```
//// ////
@ -45,7 +45,7 @@ So wie wir Pydantic zum Deklarieren von Bodys verwenden, kรถnnen wir es auch รผb
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="5 12-16" ```Python hl_lines="5 12-16"
{!> ../../../docs_src/security/tutorial002_an_py310.py!} {!> ../../docs_src/security/tutorial002_an_py310.py!}
``` ```
//// ////
@ -53,7 +53,7 @@ So wie wir Pydantic zum Deklarieren von Bodys verwenden, kรถnnen wir es auch รผb
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="5 12-16" ```Python hl_lines="5 12-16"
{!> ../../../docs_src/security/tutorial002_an_py39.py!} {!> ../../docs_src/security/tutorial002_an_py39.py!}
``` ```
//// ////
@ -61,7 +61,7 @@ So wie wir Pydantic zum Deklarieren von Bodys verwenden, kรถnnen wir es auch รผb
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="5 13-17" ```Python hl_lines="5 13-17"
{!> ../../../docs_src/security/tutorial002_an.py!} {!> ../../docs_src/security/tutorial002_an.py!}
``` ```
//// ////
@ -75,7 +75,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="3 10-14" ```Python hl_lines="3 10-14"
{!> ../../../docs_src/security/tutorial002_py310.py!} {!> ../../docs_src/security/tutorial002_py310.py!}
``` ```
//// ////
@ -89,7 +89,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="5 12-16" ```Python hl_lines="5 12-16"
{!> ../../../docs_src/security/tutorial002.py!} {!> ../../docs_src/security/tutorial002.py!}
``` ```
//// ////
@ -107,7 +107,7 @@ So wie wir es zuvor in der *Pfadoperation* direkt gemacht haben, erhรคlt unsere
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="25" ```Python hl_lines="25"
{!> ../../../docs_src/security/tutorial002_an_py310.py!} {!> ../../docs_src/security/tutorial002_an_py310.py!}
``` ```
//// ////
@ -115,7 +115,7 @@ So wie wir es zuvor in der *Pfadoperation* direkt gemacht haben, erhรคlt unsere
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="25" ```Python hl_lines="25"
{!> ../../../docs_src/security/tutorial002_an_py39.py!} {!> ../../docs_src/security/tutorial002_an_py39.py!}
``` ```
//// ////
@ -123,7 +123,7 @@ So wie wir es zuvor in der *Pfadoperation* direkt gemacht haben, erhรคlt unsere
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="26" ```Python hl_lines="26"
{!> ../../../docs_src/security/tutorial002_an.py!} {!> ../../docs_src/security/tutorial002_an.py!}
``` ```
//// ////
@ -137,7 +137,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="23" ```Python hl_lines="23"
{!> ../../../docs_src/security/tutorial002_py310.py!} {!> ../../docs_src/security/tutorial002_py310.py!}
``` ```
//// ////
@ -151,7 +151,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="25" ```Python hl_lines="25"
{!> ../../../docs_src/security/tutorial002.py!} {!> ../../docs_src/security/tutorial002.py!}
``` ```
//// ////
@ -163,7 +163,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="19-22 26-27" ```Python hl_lines="19-22 26-27"
{!> ../../../docs_src/security/tutorial002_an_py310.py!} {!> ../../docs_src/security/tutorial002_an_py310.py!}
``` ```
//// ////
@ -171,7 +171,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="19-22 26-27" ```Python hl_lines="19-22 26-27"
{!> ../../../docs_src/security/tutorial002_an_py39.py!} {!> ../../docs_src/security/tutorial002_an_py39.py!}
``` ```
//// ////
@ -179,7 +179,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="20-23 27-28" ```Python hl_lines="20-23 27-28"
{!> ../../../docs_src/security/tutorial002_an.py!} {!> ../../docs_src/security/tutorial002_an.py!}
``` ```
//// ////
@ -193,7 +193,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="17-20 24-25" ```Python hl_lines="17-20 24-25"
{!> ../../../docs_src/security/tutorial002_py310.py!} {!> ../../docs_src/security/tutorial002_py310.py!}
``` ```
//// ////
@ -207,7 +207,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="19-22 26-27" ```Python hl_lines="19-22 26-27"
{!> ../../../docs_src/security/tutorial002.py!} {!> ../../docs_src/security/tutorial002.py!}
``` ```
//// ////
@ -219,7 +219,7 @@ Und jetzt kรถnnen wir wiederum `Depends` mit unserem `get_current_user` in der *
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="31" ```Python hl_lines="31"
{!> ../../../docs_src/security/tutorial002_an_py310.py!} {!> ../../docs_src/security/tutorial002_an_py310.py!}
``` ```
//// ////
@ -227,7 +227,7 @@ Und jetzt kรถnnen wir wiederum `Depends` mit unserem `get_current_user` in der *
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="31" ```Python hl_lines="31"
{!> ../../../docs_src/security/tutorial002_an_py39.py!} {!> ../../docs_src/security/tutorial002_an_py39.py!}
``` ```
//// ////
@ -235,7 +235,7 @@ Und jetzt kรถnnen wir wiederum `Depends` mit unserem `get_current_user` in der *
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="32" ```Python hl_lines="32"
{!> ../../../docs_src/security/tutorial002_an.py!} {!> ../../docs_src/security/tutorial002_an.py!}
``` ```
//// ////
@ -249,7 +249,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="29" ```Python hl_lines="29"
{!> ../../../docs_src/security/tutorial002_py310.py!} {!> ../../docs_src/security/tutorial002_py310.py!}
``` ```
//// ////
@ -263,7 +263,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="31" ```Python hl_lines="31"
{!> ../../../docs_src/security/tutorial002.py!} {!> ../../docs_src/security/tutorial002.py!}
``` ```
//// ////
@ -323,7 +323,7 @@ Und alle diese Tausenden von *Pfadoperationen* kรถnnen nur drei Zeilen lang sein
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="30-32" ```Python hl_lines="30-32"
{!> ../../../docs_src/security/tutorial002_an_py310.py!} {!> ../../docs_src/security/tutorial002_an_py310.py!}
``` ```
//// ////
@ -331,7 +331,7 @@ Und alle diese Tausenden von *Pfadoperationen* kรถnnen nur drei Zeilen lang sein
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="30-32" ```Python hl_lines="30-32"
{!> ../../../docs_src/security/tutorial002_an_py39.py!} {!> ../../docs_src/security/tutorial002_an_py39.py!}
``` ```
//// ////
@ -339,7 +339,7 @@ Und alle diese Tausenden von *Pfadoperationen* kรถnnen nur drei Zeilen lang sein
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="31-33" ```Python hl_lines="31-33"
{!> ../../../docs_src/security/tutorial002_an.py!} {!> ../../docs_src/security/tutorial002_an.py!}
``` ```
//// ////
@ -353,7 +353,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="28-30" ```Python hl_lines="28-30"
{!> ../../../docs_src/security/tutorial002_py310.py!} {!> ../../docs_src/security/tutorial002_py310.py!}
``` ```
//// ////
@ -367,7 +367,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="30-32" ```Python hl_lines="30-32"
{!> ../../../docs_src/security/tutorial002.py!} {!> ../../docs_src/security/tutorial002.py!}
``` ```
//// ////

40
docs/de/docs/tutorial/security/oauth2-jwt.md

@ -121,7 +121,7 @@ Und noch eine, um einen Benutzer zu authentifizieren und zurรผckzugeben.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="7 48 55-56 59-60 69-75" ```Python hl_lines="7 48 55-56 59-60 69-75"
{!> ../../../docs_src/security/tutorial004_an_py310.py!} {!> ../../docs_src/security/tutorial004_an_py310.py!}
``` ```
//// ////
@ -129,7 +129,7 @@ Und noch eine, um einen Benutzer zu authentifizieren und zurรผckzugeben.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="7 48 55-56 59-60 69-75" ```Python hl_lines="7 48 55-56 59-60 69-75"
{!> ../../../docs_src/security/tutorial004_an_py39.py!} {!> ../../docs_src/security/tutorial004_an_py39.py!}
``` ```
//// ////
@ -137,7 +137,7 @@ Und noch eine, um einen Benutzer zu authentifizieren und zurรผckzugeben.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="7 49 56-57 60-61 70-76" ```Python hl_lines="7 49 56-57 60-61 70-76"
{!> ../../../docs_src/security/tutorial004_an.py!} {!> ../../docs_src/security/tutorial004_an.py!}
``` ```
//// ////
@ -151,7 +151,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="6 47 54-55 58-59 68-74" ```Python hl_lines="6 47 54-55 58-59 68-74"
{!> ../../../docs_src/security/tutorial004_py310.py!} {!> ../../docs_src/security/tutorial004_py310.py!}
``` ```
//// ////
@ -165,7 +165,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="7 48 55-56 59-60 69-75" ```Python hl_lines="7 48 55-56 59-60 69-75"
{!> ../../../docs_src/security/tutorial004.py!} {!> ../../docs_src/security/tutorial004.py!}
``` ```
//// ////
@ -207,7 +207,7 @@ Erstellen Sie eine Hilfsfunktion, um einen neuen Zugriffstoken zu generieren.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="6 12-14 28-30 78-86" ```Python hl_lines="6 12-14 28-30 78-86"
{!> ../../../docs_src/security/tutorial004_an_py310.py!} {!> ../../docs_src/security/tutorial004_an_py310.py!}
``` ```
//// ////
@ -215,7 +215,7 @@ Erstellen Sie eine Hilfsfunktion, um einen neuen Zugriffstoken zu generieren.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="6 12-14 28-30 78-86" ```Python hl_lines="6 12-14 28-30 78-86"
{!> ../../../docs_src/security/tutorial004_an_py39.py!} {!> ../../docs_src/security/tutorial004_an_py39.py!}
``` ```
//// ////
@ -223,7 +223,7 @@ Erstellen Sie eine Hilfsfunktion, um einen neuen Zugriffstoken zu generieren.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="6 13-15 29-31 79-87" ```Python hl_lines="6 13-15 29-31 79-87"
{!> ../../../docs_src/security/tutorial004_an.py!} {!> ../../docs_src/security/tutorial004_an.py!}
``` ```
//// ////
@ -237,7 +237,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="5 11-13 27-29 77-85" ```Python hl_lines="5 11-13 27-29 77-85"
{!> ../../../docs_src/security/tutorial004_py310.py!} {!> ../../docs_src/security/tutorial004_py310.py!}
``` ```
//// ////
@ -251,7 +251,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="6 12-14 28-30 78-86" ```Python hl_lines="6 12-14 28-30 78-86"
{!> ../../../docs_src/security/tutorial004.py!} {!> ../../docs_src/security/tutorial004.py!}
``` ```
//// ////
@ -267,7 +267,7 @@ Wenn der Token ungรผltig ist, geben Sie sofort einen HTTP-Fehler zurรผck.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="89-106" ```Python hl_lines="89-106"
{!> ../../../docs_src/security/tutorial004_an_py310.py!} {!> ../../docs_src/security/tutorial004_an_py310.py!}
``` ```
//// ////
@ -275,7 +275,7 @@ Wenn der Token ungรผltig ist, geben Sie sofort einen HTTP-Fehler zurรผck.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="89-106" ```Python hl_lines="89-106"
{!> ../../../docs_src/security/tutorial004_an_py39.py!} {!> ../../docs_src/security/tutorial004_an_py39.py!}
``` ```
//// ////
@ -283,7 +283,7 @@ Wenn der Token ungรผltig ist, geben Sie sofort einen HTTP-Fehler zurรผck.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="90-107" ```Python hl_lines="90-107"
{!> ../../../docs_src/security/tutorial004_an.py!} {!> ../../docs_src/security/tutorial004_an.py!}
``` ```
//// ////
@ -297,7 +297,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="88-105" ```Python hl_lines="88-105"
{!> ../../../docs_src/security/tutorial004_py310.py!} {!> ../../docs_src/security/tutorial004_py310.py!}
``` ```
//// ////
@ -311,7 +311,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="89-106" ```Python hl_lines="89-106"
{!> ../../../docs_src/security/tutorial004.py!} {!> ../../docs_src/security/tutorial004.py!}
``` ```
//// ////
@ -325,7 +325,7 @@ Erstellen Sie einen echten JWT-Zugriffstoken und geben Sie ihn zurรผck.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="117-132" ```Python hl_lines="117-132"
{!> ../../../docs_src/security/tutorial004_an_py310.py!} {!> ../../docs_src/security/tutorial004_an_py310.py!}
``` ```
//// ////
@ -333,7 +333,7 @@ Erstellen Sie einen echten JWT-Zugriffstoken und geben Sie ihn zurรผck.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="117-132" ```Python hl_lines="117-132"
{!> ../../../docs_src/security/tutorial004_an_py39.py!} {!> ../../docs_src/security/tutorial004_an_py39.py!}
``` ```
//// ////
@ -341,7 +341,7 @@ Erstellen Sie einen echten JWT-Zugriffstoken und geben Sie ihn zurรผck.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="118-133" ```Python hl_lines="118-133"
{!> ../../../docs_src/security/tutorial004_an.py!} {!> ../../docs_src/security/tutorial004_an.py!}
``` ```
//// ////
@ -355,7 +355,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="114-129" ```Python hl_lines="114-129"
{!> ../../../docs_src/security/tutorial004_py310.py!} {!> ../../docs_src/security/tutorial004_py310.py!}
``` ```
//// ////
@ -369,7 +369,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="115-130" ```Python hl_lines="115-130"
{!> ../../../docs_src/security/tutorial004.py!} {!> ../../docs_src/security/tutorial004.py!}
``` ```
//// ////

50
docs/de/docs/tutorial/security/simple-oauth2.md

@ -55,7 +55,7 @@ Importieren Sie zunรคchst `OAuth2PasswordRequestForm` und verwenden Sie es als A
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="4 78" ```Python hl_lines="4 78"
{!> ../../../docs_src/security/tutorial003_an_py310.py!} {!> ../../docs_src/security/tutorial003_an_py310.py!}
``` ```
//// ////
@ -63,7 +63,7 @@ Importieren Sie zunรคchst `OAuth2PasswordRequestForm` und verwenden Sie es als A
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="4 78" ```Python hl_lines="4 78"
{!> ../../../docs_src/security/tutorial003_an_py39.py!} {!> ../../docs_src/security/tutorial003_an_py39.py!}
``` ```
//// ////
@ -71,7 +71,7 @@ Importieren Sie zunรคchst `OAuth2PasswordRequestForm` und verwenden Sie es als A
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="4 79" ```Python hl_lines="4 79"
{!> ../../../docs_src/security/tutorial003_an.py!} {!> ../../docs_src/security/tutorial003_an.py!}
``` ```
//// ////
@ -85,7 +85,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="2 74" ```Python hl_lines="2 74"
{!> ../../../docs_src/security/tutorial003_py310.py!} {!> ../../docs_src/security/tutorial003_py310.py!}
``` ```
//// ////
@ -99,7 +99,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="4 76" ```Python hl_lines="4 76"
{!> ../../../docs_src/security/tutorial003.py!} {!> ../../docs_src/security/tutorial003.py!}
``` ```
//// ////
@ -153,7 +153,7 @@ Fรผr den Fehler verwenden wir die Exception `HTTPException`:
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="3 79-81" ```Python hl_lines="3 79-81"
{!> ../../../docs_src/security/tutorial003_an_py310.py!} {!> ../../docs_src/security/tutorial003_an_py310.py!}
``` ```
//// ////
@ -161,7 +161,7 @@ Fรผr den Fehler verwenden wir die Exception `HTTPException`:
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="3 79-81" ```Python hl_lines="3 79-81"
{!> ../../../docs_src/security/tutorial003_an_py39.py!} {!> ../../docs_src/security/tutorial003_an_py39.py!}
``` ```
//// ////
@ -169,7 +169,7 @@ Fรผr den Fehler verwenden wir die Exception `HTTPException`:
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="3 80-82" ```Python hl_lines="3 80-82"
{!> ../../../docs_src/security/tutorial003_an.py!} {!> ../../docs_src/security/tutorial003_an.py!}
``` ```
//// ////
@ -183,7 +183,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="1 75-77" ```Python hl_lines="1 75-77"
{!> ../../../docs_src/security/tutorial003_py310.py!} {!> ../../docs_src/security/tutorial003_py310.py!}
``` ```
//// ////
@ -197,7 +197,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="3 77-79" ```Python hl_lines="3 77-79"
{!> ../../../docs_src/security/tutorial003.py!} {!> ../../docs_src/security/tutorial003.py!}
``` ```
//// ////
@ -229,7 +229,7 @@ Der Dieb kann also nicht versuchen, die gleichen Passwรถrter in einem anderen Sy
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="82-85" ```Python hl_lines="82-85"
{!> ../../../docs_src/security/tutorial003_an_py310.py!} {!> ../../docs_src/security/tutorial003_an_py310.py!}
``` ```
//// ////
@ -237,7 +237,7 @@ Der Dieb kann also nicht versuchen, die gleichen Passwรถrter in einem anderen Sy
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="82-85" ```Python hl_lines="82-85"
{!> ../../../docs_src/security/tutorial003_an_py39.py!} {!> ../../docs_src/security/tutorial003_an_py39.py!}
``` ```
//// ////
@ -245,7 +245,7 @@ Der Dieb kann also nicht versuchen, die gleichen Passwรถrter in einem anderen Sy
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="83-86" ```Python hl_lines="83-86"
{!> ../../../docs_src/security/tutorial003_an.py!} {!> ../../docs_src/security/tutorial003_an.py!}
``` ```
//// ////
@ -259,7 +259,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="78-81" ```Python hl_lines="78-81"
{!> ../../../docs_src/security/tutorial003_py310.py!} {!> ../../docs_src/security/tutorial003_py310.py!}
``` ```
//// ////
@ -273,7 +273,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="80-83" ```Python hl_lines="80-83"
{!> ../../../docs_src/security/tutorial003.py!} {!> ../../docs_src/security/tutorial003.py!}
``` ```
//// ////
@ -321,7 +321,7 @@ Aber konzentrieren wir uns zunรคchst auf die spezifischen Details, die wir benรถ
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="87" ```Python hl_lines="87"
{!> ../../../docs_src/security/tutorial003_an_py310.py!} {!> ../../docs_src/security/tutorial003_an_py310.py!}
``` ```
//// ////
@ -329,7 +329,7 @@ Aber konzentrieren wir uns zunรคchst auf die spezifischen Details, die wir benรถ
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="87" ```Python hl_lines="87"
{!> ../../../docs_src/security/tutorial003_an_py39.py!} {!> ../../docs_src/security/tutorial003_an_py39.py!}
``` ```
//// ////
@ -337,7 +337,7 @@ Aber konzentrieren wir uns zunรคchst auf die spezifischen Details, die wir benรถ
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="88" ```Python hl_lines="88"
{!> ../../../docs_src/security/tutorial003_an.py!} {!> ../../docs_src/security/tutorial003_an.py!}
``` ```
//// ////
@ -351,7 +351,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="83" ```Python hl_lines="83"
{!> ../../../docs_src/security/tutorial003_py310.py!} {!> ../../docs_src/security/tutorial003_py310.py!}
``` ```
//// ////
@ -365,7 +365,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="85" ```Python hl_lines="85"
{!> ../../../docs_src/security/tutorial003.py!} {!> ../../docs_src/security/tutorial003.py!}
``` ```
//// ////
@ -397,7 +397,7 @@ In unserem Endpunkt erhalten wir also nur dann einen Benutzer, wenn der Benutzer
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python hl_lines="58-66 69-74 94" ```Python hl_lines="58-66 69-74 94"
{!> ../../../docs_src/security/tutorial003_an_py310.py!} {!> ../../docs_src/security/tutorial003_an_py310.py!}
``` ```
//// ////
@ -405,7 +405,7 @@ In unserem Endpunkt erhalten wir also nur dann einen Benutzer, wenn der Benutzer
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python hl_lines="58-66 69-74 94" ```Python hl_lines="58-66 69-74 94"
{!> ../../../docs_src/security/tutorial003_an_py39.py!} {!> ../../docs_src/security/tutorial003_an_py39.py!}
``` ```
//// ////
@ -413,7 +413,7 @@ In unserem Endpunkt erhalten wir also nur dann einen Benutzer, wenn der Benutzer
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python hl_lines="59-67 70-75 95" ```Python hl_lines="59-67 70-75 95"
{!> ../../../docs_src/security/tutorial003_an.py!} {!> ../../docs_src/security/tutorial003_an.py!}
``` ```
//// ////
@ -427,7 +427,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="56-64 67-70 88" ```Python hl_lines="56-64 67-70 88"
{!> ../../../docs_src/security/tutorial003_py310.py!} {!> ../../docs_src/security/tutorial003_py310.py!}
``` ```
//// ////
@ -441,7 +441,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python hl_lines="58-66 69-72 90" ```Python hl_lines="58-66 69-72 90"
{!> ../../../docs_src/security/tutorial003.py!} {!> ../../docs_src/security/tutorial003.py!}
``` ```
//// ////

2
docs/de/docs/tutorial/static-files.md

@ -8,7 +8,7 @@ Mit `StaticFiles` kรถnnen Sie statische Dateien aus einem Verzeichnis automatisc
* โ€žMountenโ€œ Sie eine `StaticFiles()`-Instanz in einem bestimmten Pfad. * โ€žMountenโ€œ Sie eine `StaticFiles()`-Instanz in einem bestimmten Pfad.
```Python hl_lines="2 6" ```Python hl_lines="2 6"
{!../../../docs_src/static_files/tutorial001.py!} {!../../docs_src/static_files/tutorial001.py!}
``` ```
/// note | "Technische Details" /// note | "Technische Details"

18
docs/de/docs/tutorial/testing.md

@ -27,7 +27,7 @@ Verwenden Sie das `TestClient`-Objekt auf die gleiche Weise wie `httpx`.
Schreiben Sie einfache `assert`-Anweisungen mit den Standard-Python-Ausdrรผcken, die Sie รผberprรผfen mรผssen (wiederum, Standard-`pytest`). Schreiben Sie einfache `assert`-Anweisungen mit den Standard-Python-Ausdrรผcken, die Sie รผberprรผfen mรผssen (wiederum, Standard-`pytest`).
```Python hl_lines="2 12 15-18" ```Python hl_lines="2 12 15-18"
{!../../../docs_src/app_testing/tutorial001.py!} {!../../docs_src/app_testing/tutorial001.py!}
``` ```
/// tip | "Tipp" /// tip | "Tipp"
@ -75,7 +75,7 @@ In der Datei `main.py` haben Sie Ihre **FastAPI**-Anwendung:
```Python ```Python
{!../../../docs_src/app_testing/main.py!} {!../../docs_src/app_testing/main.py!}
``` ```
### Testdatei ### Testdatei
@ -93,7 +93,7 @@ Dann kรถnnten Sie eine Datei `test_main.py` mit Ihren Tests haben. Sie kรถnnte s
Da sich diese Datei im selben Package befindet, kรถnnen Sie relative Importe verwenden, um das Objekt `app` aus dem `main`-Modul (`main.py`) zu importieren: Da sich diese Datei im selben Package befindet, kรถnnen Sie relative Importe verwenden, um das Objekt `app` aus dem `main`-Modul (`main.py`) zu importieren:
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/app_testing/test_main.py!} {!../../docs_src/app_testing/test_main.py!}
``` ```
... und haben den Code fรผr die Tests wie zuvor. ... und haben den Code fรผr die Tests wie zuvor.
@ -125,7 +125,7 @@ Beide *Pfadoperationen* erfordern einen `X-Token`-Header.
//// tab | Python 3.10+ //// tab | Python 3.10+
```Python ```Python
{!> ../../../docs_src/app_testing/app_b_an_py310/main.py!} {!> ../../docs_src/app_testing/app_b_an_py310/main.py!}
``` ```
//// ////
@ -133,7 +133,7 @@ Beide *Pfadoperationen* erfordern einen `X-Token`-Header.
//// tab | Python 3.9+ //// tab | Python 3.9+
```Python ```Python
{!> ../../../docs_src/app_testing/app_b_an_py39/main.py!} {!> ../../docs_src/app_testing/app_b_an_py39/main.py!}
``` ```
//// ////
@ -141,7 +141,7 @@ Beide *Pfadoperationen* erfordern einen `X-Token`-Header.
//// tab | Python 3.8+ //// tab | Python 3.8+
```Python ```Python
{!> ../../../docs_src/app_testing/app_b_an/main.py!} {!> ../../docs_src/app_testing/app_b_an/main.py!}
``` ```
//// ////
@ -155,7 +155,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python ```Python
{!> ../../../docs_src/app_testing/app_b_py310/main.py!} {!> ../../docs_src/app_testing/app_b_py310/main.py!}
``` ```
//// ////
@ -169,7 +169,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
/// ///
```Python ```Python
{!> ../../../docs_src/app_testing/app_b/main.py!} {!> ../../docs_src/app_testing/app_b/main.py!}
``` ```
//// ////
@ -179,7 +179,7 @@ Bevorzugen Sie die `Annotated`-Version, falls mรถglich.
AnschlieรŸend kรถnnten Sie `test_main.py` mit den erweiterten Tests aktualisieren: AnschlieรŸend kรถnnten Sie `test_main.py` mit den erweiterten Tests aktualisieren:
```Python ```Python
{!> ../../../docs_src/app_testing/app_b/test_main.py!} {!> ../../docs_src/app_testing/app_b/test_main.py!}
``` ```
Wenn Sie mรถchten, dass der Client Informationen im Request รผbergibt und Sie nicht wissen, wie das geht, kรถnnen Sie suchen (googeln), wie es mit `httpx` gemacht wird, oder sogar, wie es mit `requests` gemacht wird, da das Design von HTTPX auf dem Design von Requests basiert. Wenn Sie mรถchten, dass der Client Informationen im Request รผbergibt und Sie nicht wissen, wie das geht, kรถnnen Sie suchen (googeln), wie es mit `httpx` gemacht wird, oder sogar, wie es mit `requests` gemacht wird, da das Design von HTTPX auf dem Design von Requests basiert.

8
docs/em/docs/advanced/additional-responses.md

@ -27,7 +27,7 @@
๐Ÿ–ผ, ๐Ÿ“ฃ โž•1๏ธโƒฃ ๐Ÿ“จ โฎ๏ธ ๐Ÿ‘” ๐Ÿ“Ÿ `404` &amp; Pydantic ๐Ÿท `Message`, ๐Ÿ‘† ๐Ÿ’ช โœ: ๐Ÿ–ผ, ๐Ÿ“ฃ โž•1๏ธโƒฃ ๐Ÿ“จ โฎ๏ธ ๐Ÿ‘” ๐Ÿ“Ÿ `404` &amp; Pydantic ๐Ÿท `Message`, ๐Ÿ‘† ๐Ÿ’ช โœ:
```Python hl_lines="18 22" ```Python hl_lines="18 22"
{!../../../docs_src/additional_responses/tutorial001.py!} {!../../docs_src/additional_responses/tutorial001.py!}
``` ```
/// note /// note
@ -178,7 +178,7 @@
๐Ÿ–ผ, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿšฎ ๐ŸŒ– ๐Ÿ“ป ๐Ÿ†Ž `image/png`, ๐Ÿ“ฃ ๐Ÿ‘ˆ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ* ๐Ÿ’ช ๐Ÿ“จ ๐ŸŽป ๐ŸŽš (โฎ๏ธ ๐Ÿ“ป ๐Ÿ†Ž `application/json`) โš–๏ธ ๐Ÿ‡ฉ๐Ÿ‡ด ๐Ÿ–ผ: ๐Ÿ–ผ, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿšฎ ๐ŸŒ– ๐Ÿ“ป ๐Ÿ†Ž `image/png`, ๐Ÿ“ฃ ๐Ÿ‘ˆ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ* ๐Ÿ’ช ๐Ÿ“จ ๐ŸŽป ๐ŸŽš (โฎ๏ธ ๐Ÿ“ป ๐Ÿ†Ž `application/json`) โš–๏ธ ๐Ÿ‡ฉ๐Ÿ‡ด ๐Ÿ–ผ:
```Python hl_lines="19-24 28" ```Python hl_lines="19-24 28"
{!../../../docs_src/additional_responses/tutorial002.py!} {!../../docs_src/additional_responses/tutorial002.py!}
``` ```
/// note /// note
@ -208,7 +208,7 @@
&amp; ๐Ÿ“จ โฎ๏ธ ๐Ÿ‘” ๐Ÿ“Ÿ `200` ๐Ÿ‘ˆ โš™๏ธ ๐Ÿ‘† `response_model`, โœ‹๏ธ ๐Ÿ”Œ ๐Ÿ›ƒ `example`: &amp; ๐Ÿ“จ โฎ๏ธ ๐Ÿ‘” ๐Ÿ“Ÿ `200` ๐Ÿ‘ˆ โš™๏ธ ๐Ÿ‘† `response_model`, โœ‹๏ธ ๐Ÿ”Œ ๐Ÿ›ƒ `example`:
```Python hl_lines="20-31" ```Python hl_lines="20-31"
{!../../../docs_src/additional_responses/tutorial003.py!} {!../../docs_src/additional_responses/tutorial003.py!}
``` ```
โšซ๏ธ ๐Ÿ”œ ๐ŸŒ ๐ŸŒ€ &amp; ๐Ÿ”Œ ๐Ÿ‘† ๐Ÿ—„, &amp; ๐ŸŽฆ ๐Ÿ› ๏ธ ๐Ÿฉบ: โšซ๏ธ ๐Ÿ”œ ๐ŸŒ ๐ŸŒ€ &amp; ๐Ÿ”Œ ๐Ÿ‘† ๐Ÿ—„, &amp; ๐ŸŽฆ ๐Ÿ› ๏ธ ๐Ÿฉบ:
@ -244,7 +244,7 @@ new_dict = {**old_dict, "new key": "new value"}
๐Ÿ–ผ: ๐Ÿ–ผ:
```Python hl_lines="13-17 26" ```Python hl_lines="13-17 26"
{!../../../docs_src/additional_responses/tutorial004.py!} {!../../docs_src/additional_responses/tutorial004.py!}
``` ```
## ๐ŸŒ– โ„น ๐Ÿ”ƒ ๐Ÿ—„ ๐Ÿ“จ ## ๐ŸŒ– โ„น ๐Ÿ”ƒ ๐Ÿ—„ ๐Ÿ“จ

2
docs/em/docs/advanced/additional-status-codes.md

@ -15,7 +15,7 @@
๐Ÿ† ๐Ÿ‘ˆ, ๐Ÿ—„ `JSONResponse`, &amp; ๐Ÿ“จ ๐Ÿ‘† ๐ŸŽš ๐Ÿ“ค ๐Ÿ”—, โš’ `status_code` ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ’š: ๐Ÿ† ๐Ÿ‘ˆ, ๐Ÿ—„ `JSONResponse`, &amp; ๐Ÿ“จ ๐Ÿ‘† ๐ŸŽš ๐Ÿ“ค ๐Ÿ”—, โš’ `status_code` ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ’š:
```Python hl_lines="4 25" ```Python hl_lines="4 25"
{!../../../docs_src/additional_status_codes/tutorial001.py!} {!../../docs_src/additional_status_codes/tutorial001.py!}
``` ```
/// warning /// warning

8
docs/em/docs/advanced/advanced-dependencies.md

@ -19,7 +19,7 @@
๐Ÿ‘ˆ, ๐Ÿ‘ฅ ๐Ÿ“ฃ ๐Ÿ‘ฉโ€๐Ÿ”ฌ `__call__`: ๐Ÿ‘ˆ, ๐Ÿ‘ฅ ๐Ÿ“ฃ ๐Ÿ‘ฉโ€๐Ÿ”ฌ `__call__`:
```Python hl_lines="10" ```Python hl_lines="10"
{!../../../docs_src/dependencies/tutorial011.py!} {!../../docs_src/dependencies/tutorial011.py!}
``` ```
๐Ÿ‘‰ ๐Ÿ’ผ, ๐Ÿ‘‰ `__call__` โšซ๏ธโ” **FastAPI** ๐Ÿ”œ โš™๏ธ โœ… ๐ŸŒ– ๐Ÿ”ข &amp; ๐ŸŽง-๐Ÿ”—, &amp; ๐Ÿ‘‰ โšซ๏ธโ” ๐Ÿ”œ ๐Ÿค™ ๐Ÿšถโ€โ™€๏ธ ๐Ÿ’ฒ ๐Ÿ”ข ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* โช. ๐Ÿ‘‰ ๐Ÿ’ผ, ๐Ÿ‘‰ `__call__` โšซ๏ธโ” **FastAPI** ๐Ÿ”œ โš™๏ธ โœ… ๐ŸŒ– ๐Ÿ”ข &amp; ๐ŸŽง-๐Ÿ”—, &amp; ๐Ÿ‘‰ โšซ๏ธโ” ๐Ÿ”œ ๐Ÿค™ ๐Ÿšถโ€โ™€๏ธ ๐Ÿ’ฒ ๐Ÿ”ข ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* โช.
@ -29,7 +29,7 @@
&amp; ๐Ÿ”œ, ๐Ÿ‘ฅ ๐Ÿ’ช โš™๏ธ `__init__` ๐Ÿ“ฃ ๐Ÿ”ข ๐Ÿ‘ ๐Ÿ‘ˆ ๐Ÿ‘ฅ ๐Ÿ’ช โš™๏ธ "๐Ÿ”—" ๐Ÿ”—: &amp; ๐Ÿ”œ, ๐Ÿ‘ฅ ๐Ÿ’ช โš™๏ธ `__init__` ๐Ÿ“ฃ ๐Ÿ”ข ๐Ÿ‘ ๐Ÿ‘ˆ ๐Ÿ‘ฅ ๐Ÿ’ช โš™๏ธ "๐Ÿ”—" ๐Ÿ”—:
```Python hl_lines="7" ```Python hl_lines="7"
{!../../../docs_src/dependencies/tutorial011.py!} {!../../docs_src/dependencies/tutorial011.py!}
``` ```
๐Ÿ‘‰ ๐Ÿ’ผ, **FastAPI** ๐Ÿ† ๐Ÿšซ โฑ ๐Ÿ‘† โš–๏ธ ๐Ÿ’… ๐Ÿ”ƒ `__init__`, ๐Ÿ‘ฅ ๐Ÿ”œ โš™๏ธ โšซ๏ธ ๐Ÿ”— ๐Ÿ‘† ๐Ÿ“Ÿ. ๐Ÿ‘‰ ๐Ÿ’ผ, **FastAPI** ๐Ÿ† ๐Ÿšซ โฑ ๐Ÿ‘† โš–๏ธ ๐Ÿ’… ๐Ÿ”ƒ `__init__`, ๐Ÿ‘ฅ ๐Ÿ”œ โš™๏ธ โšซ๏ธ ๐Ÿ”— ๐Ÿ‘† ๐Ÿ“Ÿ.
@ -39,7 +39,7 @@
๐Ÿ‘ฅ ๐Ÿ’ช โœ ๐Ÿ‘ ๐Ÿ‘‰ ๐ŸŽ“ โฎ๏ธ: ๐Ÿ‘ฅ ๐Ÿ’ช โœ ๐Ÿ‘ ๐Ÿ‘‰ ๐ŸŽ“ โฎ๏ธ:
```Python hl_lines="16" ```Python hl_lines="16"
{!../../../docs_src/dependencies/tutorial011.py!} {!../../docs_src/dependencies/tutorial011.py!}
``` ```
&amp; ๐Ÿ‘ˆ ๐ŸŒŒ ๐Ÿ‘ฅ ๐Ÿ’ช "๐Ÿ”—" ๐Ÿ‘† ๐Ÿ”—, ๐Ÿ‘ˆ ๐Ÿ”œ โœ”๏ธ `"bar"` ๐Ÿ”˜ โšซ๏ธ, ๐Ÿ”ข `checker.fixed_content`. &amp; ๐Ÿ‘ˆ ๐ŸŒŒ ๐Ÿ‘ฅ ๐Ÿ’ช "๐Ÿ”—" ๐Ÿ‘† ๐Ÿ”—, ๐Ÿ‘ˆ ๐Ÿ”œ โœ”๏ธ `"bar"` ๐Ÿ”˜ โšซ๏ธ, ๐Ÿ”ข `checker.fixed_content`.
@ -57,7 +57,7 @@ checker(q="somequery")
...&amp; ๐Ÿšถโ€โ™€๏ธ โšซ๏ธโ” ๐Ÿ‘ˆ ๐Ÿ“จ ๐Ÿ’ฒ ๐Ÿ”— ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿ”ข `fixed_content_included`: ...&amp; ๐Ÿšถโ€โ™€๏ธ โšซ๏ธโ” ๐Ÿ‘ˆ ๐Ÿ“จ ๐Ÿ’ฒ ๐Ÿ”— ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿ”ข `fixed_content_included`:
```Python hl_lines="20" ```Python hl_lines="20"
{!../../../docs_src/dependencies/tutorial011.py!} {!../../docs_src/dependencies/tutorial011.py!}
``` ```
/// tip /// tip

8
docs/em/docs/advanced/async-tests.md

@ -33,13 +33,13 @@
๐Ÿ“ `main.py` ๐Ÿ”œ โœ”๏ธ: ๐Ÿ“ `main.py` ๐Ÿ”œ โœ”๏ธ:
```Python ```Python
{!../../../docs_src/async_tests/main.py!} {!../../docs_src/async_tests/main.py!}
``` ```
๐Ÿ“ `test_main.py` ๐Ÿ”œ โœ”๏ธ ๐Ÿ’ฏ `main.py`, โšซ๏ธ ๐Ÿ’ช ๐Ÿ‘€ ๐Ÿ’– ๐Ÿ‘‰ ๐Ÿ”œ: ๐Ÿ“ `test_main.py` ๐Ÿ”œ โœ”๏ธ ๐Ÿ’ฏ `main.py`, โšซ๏ธ ๐Ÿ’ช ๐Ÿ‘€ ๐Ÿ’– ๐Ÿ‘‰ ๐Ÿ”œ:
```Python ```Python
{!../../../docs_src/async_tests/test_main.py!} {!../../docs_src/async_tests/test_main.py!}
``` ```
## ๐Ÿƒ โšซ๏ธ ## ๐Ÿƒ โšซ๏ธ
@ -61,7 +61,7 @@ $ pytest
๐Ÿ“‘ `@pytest.mark.anyio` ๐Ÿ’ฌ โœณ ๐Ÿ‘ˆ ๐Ÿ‘‰ ๐Ÿ’ฏ ๐Ÿ”ข ๐Ÿ”œ ๐Ÿค™ ๐Ÿ”: ๐Ÿ“‘ `@pytest.mark.anyio` ๐Ÿ’ฌ โœณ ๐Ÿ‘ˆ ๐Ÿ‘‰ ๐Ÿ’ฏ ๐Ÿ”ข ๐Ÿ”œ ๐Ÿค™ ๐Ÿ”:
```Python hl_lines="7" ```Python hl_lines="7"
{!../../../docs_src/async_tests/test_main.py!} {!../../docs_src/async_tests/test_main.py!}
``` ```
/// tip /// tip
@ -73,7 +73,7 @@ $ pytest
โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช โœ `AsyncClient` โฎ๏ธ ๐Ÿ“ฑ, &amp; ๐Ÿ“จ ๐Ÿ” ๐Ÿ“จ โšซ๏ธ, โš™๏ธ `await`. โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช โœ `AsyncClient` โฎ๏ธ ๐Ÿ“ฑ, &amp; ๐Ÿ“จ ๐Ÿ” ๐Ÿ“จ โšซ๏ธ, โš™๏ธ `await`.
```Python hl_lines="9-12" ```Python hl_lines="9-12"
{!../../../docs_src/async_tests/test_main.py!} {!../../docs_src/async_tests/test_main.py!}
``` ```
๐Ÿ‘‰ ๐ŸŒ“: ๐Ÿ‘‰ ๐ŸŒ“:

8
docs/em/docs/advanced/behind-a-proxy.md

@ -95,7 +95,7 @@ $ uvicorn main:app --root-path /api/v1
๐Ÿ“ฅ ๐Ÿ‘ฅ โœ… โšซ๏ธ ๐Ÿ“ง ๐ŸŽฆ ๐ŸŽฏ. ๐Ÿ“ฅ ๐Ÿ‘ฅ โœ… โšซ๏ธ ๐Ÿ“ง ๐ŸŽฆ ๐ŸŽฏ.
```Python hl_lines="8" ```Python hl_lines="8"
{!../../../docs_src/behind_a_proxy/tutorial001.py!} {!../../docs_src/behind_a_proxy/tutorial001.py!}
``` ```
โคด๏ธ, ๐Ÿšฅ ๐Ÿ‘† โ–ถ๏ธ Uvicorn โฎ๏ธ: โคด๏ธ, ๐Ÿšฅ ๐Ÿ‘† โ–ถ๏ธ Uvicorn โฎ๏ธ:
@ -124,7 +124,7 @@ $ uvicorn main:app --root-path /api/v1
๐Ÿ‘, ๐Ÿšฅ ๐Ÿ‘† ๐Ÿšซ โœ”๏ธ ๐ŸŒŒ ๐Ÿšš ๐Ÿ“‹ โธ ๐ŸŽ› ๐Ÿ’– `--root-path` โš–๏ธ ๐ŸŒ“, ๐Ÿ‘† ๐Ÿ’ช โš’ `root_path` ๐Ÿ”ข ๐Ÿ•โ” ๐Ÿ— ๐Ÿ‘† FastAPI ๐Ÿ“ฑ: ๐Ÿ‘, ๐Ÿšฅ ๐Ÿ‘† ๐Ÿšซ โœ”๏ธ ๐ŸŒŒ ๐Ÿšš ๐Ÿ“‹ โธ ๐ŸŽ› ๐Ÿ’– `--root-path` โš–๏ธ ๐ŸŒ“, ๐Ÿ‘† ๐Ÿ’ช โš’ `root_path` ๐Ÿ”ข ๐Ÿ•โ” ๐Ÿ— ๐Ÿ‘† FastAPI ๐Ÿ“ฑ:
```Python hl_lines="3" ```Python hl_lines="3"
{!../../../docs_src/behind_a_proxy/tutorial002.py!} {!../../docs_src/behind_a_proxy/tutorial002.py!}
``` ```
๐Ÿšถโ€โ™€๏ธ `root_path` `FastAPI` ๐Ÿ”œ ๐ŸŒ“ ๐Ÿšถโ€โ™€๏ธ `--root-path` ๐Ÿ“‹ โธ ๐ŸŽ› Uvicorn โš–๏ธ Hypercorn. ๐Ÿšถโ€โ™€๏ธ `root_path` `FastAPI` ๐Ÿ”œ ๐ŸŒ“ ๐Ÿšถโ€โ™€๏ธ `--root-path` ๐Ÿ“‹ โธ ๐ŸŽ› Uvicorn โš–๏ธ Hypercorn.
@ -306,7 +306,7 @@ $ uvicorn main:app --root-path /api/v1
๐Ÿ–ผ: ๐Ÿ–ผ:
```Python hl_lines="4-7" ```Python hl_lines="4-7"
{!../../../docs_src/behind_a_proxy/tutorial003.py!} {!../../docs_src/behind_a_proxy/tutorial003.py!}
``` ```
๐Ÿ”œ ๐Ÿ— ๐Ÿ—„ ๐Ÿ”— ๐Ÿ’–: ๐Ÿ”œ ๐Ÿ— ๐Ÿ—„ ๐Ÿ”— ๐Ÿ’–:
@ -355,7 +355,7 @@ $ uvicorn main:app --root-path /api/v1
๐Ÿšฅ ๐Ÿ‘† ๐Ÿšซ ๐Ÿ’š **FastAPI** ๐Ÿ”Œ ๐Ÿง ๐Ÿ’ฝ โš™๏ธ `root_path`, ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ ๐Ÿ”ข `root_path_in_servers=False`: ๐Ÿšฅ ๐Ÿ‘† ๐Ÿšซ ๐Ÿ’š **FastAPI** ๐Ÿ”Œ ๐Ÿง ๐Ÿ’ฝ โš™๏ธ `root_path`, ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ ๐Ÿ”ข `root_path_in_servers=False`:
```Python hl_lines="9" ```Python hl_lines="9"
{!../../../docs_src/behind_a_proxy/tutorial004.py!} {!../../docs_src/behind_a_proxy/tutorial004.py!}
``` ```
&amp; โคด๏ธ โšซ๏ธ ๐Ÿ† ๐Ÿšซ ๐Ÿ”Œ โšซ๏ธ ๐Ÿ—„ ๐Ÿ”—. &amp; โคด๏ธ โšซ๏ธ ๐Ÿ† ๐Ÿšซ ๐Ÿ”Œ โšซ๏ธ ๐Ÿ—„ ๐Ÿ”—.

32
docs/em/docs/advanced/custom-response.md

@ -31,7 +31,7 @@
โœ‹๏ธ ๐Ÿšฅ ๐Ÿ‘† ๐ŸŽฏ ๐Ÿ‘ˆ ๐ŸŽš ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ›ฌ **๐ŸŽป โฎ๏ธ ๐ŸŽป**, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿšถโ€โ™€๏ธ โšซ๏ธ ๐Ÿ”— ๐Ÿ“จ ๐ŸŽ“ &amp; โŽ โž• ๐ŸŒฅ ๐Ÿ‘ˆ FastAPI ๐Ÿ”œ โœ”๏ธ ๐Ÿšถโ€โ™€๏ธ ๐Ÿ‘† ๐Ÿ“จ ๐ŸŽš ๐Ÿ”˜ `jsonable_encoder` โญ ๐Ÿšถโ€โ™€๏ธ โšซ๏ธ ๐Ÿ“จ ๐ŸŽ“. โœ‹๏ธ ๐Ÿšฅ ๐Ÿ‘† ๐ŸŽฏ ๐Ÿ‘ˆ ๐ŸŽš ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ›ฌ **๐ŸŽป โฎ๏ธ ๐ŸŽป**, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿšถโ€โ™€๏ธ โšซ๏ธ ๐Ÿ”— ๐Ÿ“จ ๐ŸŽ“ &amp; โŽ โž• ๐ŸŒฅ ๐Ÿ‘ˆ FastAPI ๐Ÿ”œ โœ”๏ธ ๐Ÿšถโ€โ™€๏ธ ๐Ÿ‘† ๐Ÿ“จ ๐ŸŽš ๐Ÿ”˜ `jsonable_encoder` โญ ๐Ÿšถโ€โ™€๏ธ โšซ๏ธ ๐Ÿ“จ ๐ŸŽ“.
```Python hl_lines="2 7" ```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial001b.py!} {!../../docs_src/custom_response/tutorial001b.py!}
``` ```
/// info /// info
@ -58,7 +58,7 @@
* ๐Ÿšถโ€โ™€๏ธ `HTMLResponse` ๐Ÿ”ข `response_class` ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ‘จโ€๐ŸŽจ*. * ๐Ÿšถโ€โ™€๏ธ `HTMLResponse` ๐Ÿ”ข `response_class` ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ ๐Ÿ‘จโ€๐ŸŽจ*.
```Python hl_lines="2 7" ```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial002.py!} {!../../docs_src/custom_response/tutorial002.py!}
``` ```
/// info /// info
@ -78,7 +78,7 @@
๐ŸŽ ๐Ÿ–ผ โšช๏ธโžก๏ธ ๐Ÿ”›, ๐Ÿ›ฌ `HTMLResponse`, ๐Ÿ’ช ๐Ÿ‘€ ๐Ÿ’–: ๐ŸŽ ๐Ÿ–ผ โšช๏ธโžก๏ธ ๐Ÿ”›, ๐Ÿ›ฌ `HTMLResponse`, ๐Ÿ’ช ๐Ÿ‘€ ๐Ÿ’–:
```Python hl_lines="2 7 19" ```Python hl_lines="2 7 19"
{!../../../docs_src/custom_response/tutorial003.py!} {!../../docs_src/custom_response/tutorial003.py!}
``` ```
/// warning /// warning
@ -104,7 +104,7 @@
๐Ÿ–ผ, โšซ๏ธ ๐Ÿ’ช ๐Ÿ•ณ ๐Ÿ’–: ๐Ÿ–ผ, โšซ๏ธ ๐Ÿ’ช ๐Ÿ•ณ ๐Ÿ’–:
```Python hl_lines="7 21 23" ```Python hl_lines="7 21 23"
{!../../../docs_src/custom_response/tutorial004.py!} {!../../docs_src/custom_response/tutorial004.py!}
``` ```
๐Ÿ‘‰ ๐Ÿ–ผ, ๐Ÿ”ข `generate_html_response()` โช ๐Ÿ— &amp; ๐Ÿ“จ `Response` โ†ฉ๏ธ ๐Ÿ›ฌ ๐Ÿ•ธ `str`. ๐Ÿ‘‰ ๐Ÿ–ผ, ๐Ÿ”ข `generate_html_response()` โช ๐Ÿ— &amp; ๐Ÿ“จ `Response` โ†ฉ๏ธ ๐Ÿ›ฌ ๐Ÿ•ธ `str`.
@ -145,7 +145,7 @@
FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž ๐ŸŽš, โš“๏ธ ๐Ÿ”› = &amp; ๐Ÿ” = โœ ๐Ÿ†Ž. FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž ๐ŸŽš, โš“๏ธ ๐Ÿ”› = &amp; ๐Ÿ” = โœ ๐Ÿ†Ž.
```Python hl_lines="1 18" ```Python hl_lines="1 18"
{!../../../docs_src/response_directly/tutorial002.py!} {!../../docs_src/response_directly/tutorial002.py!}
``` ```
### `HTMLResponse` ### `HTMLResponse`
@ -157,7 +157,7 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
โœŠ โœ โš–๏ธ ๐Ÿ”ข &amp; ๐Ÿ“จ โœ… โœ ๐Ÿ“จ. โœŠ โœ โš–๏ธ ๐Ÿ”ข &amp; ๐Ÿ“จ โœ… โœ ๐Ÿ“จ.
```Python hl_lines="2 7 9" ```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial005.py!} {!../../docs_src/custom_response/tutorial005.py!}
``` ```
### `JSONResponse` ### `JSONResponse`
@ -181,7 +181,7 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
/// ///
```Python hl_lines="2 7" ```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial001.py!} {!../../docs_src/custom_response/tutorial001.py!}
``` ```
/// tip /// tip
@ -197,7 +197,7 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ `RedirectResponse` ๐Ÿ”—: ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ `RedirectResponse` ๐Ÿ”—:
```Python hl_lines="2 9" ```Python hl_lines="2 9"
{!../../../docs_src/custom_response/tutorial006.py!} {!../../docs_src/custom_response/tutorial006.py!}
``` ```
--- ---
@ -206,7 +206,7 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
```Python hl_lines="2 7 9" ```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial006b.py!} {!../../docs_src/custom_response/tutorial006b.py!}
``` ```
๐Ÿšฅ ๐Ÿ‘† ๐Ÿ‘ˆ, โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ“› ๐Ÿ”— โšช๏ธโžก๏ธ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ* ๐Ÿ”ข. ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ‘ˆ, โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ“› ๐Ÿ”— โšช๏ธโžก๏ธ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ* ๐Ÿ”ข.
@ -218,7 +218,7 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `status_code` ๐Ÿ”ข ๐ŸŒ€ โฎ๏ธ `response_class` ๐Ÿ”ข: ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `status_code` ๐Ÿ”ข ๐ŸŒ€ โฎ๏ธ `response_class` ๐Ÿ”ข:
```Python hl_lines="2 7 9" ```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial006c.py!} {!../../docs_src/custom_response/tutorial006c.py!}
``` ```
### `StreamingResponse` ### `StreamingResponse`
@ -226,7 +226,7 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
โœŠ ๐Ÿ” ๐Ÿš‚ โš–๏ธ ๐Ÿ˜ ๐Ÿš‚/๐ŸŽป &amp; ๐ŸŽ ๐Ÿ“จ ๐Ÿ’ช. โœŠ ๐Ÿ” ๐Ÿš‚ โš–๏ธ ๐Ÿ˜ ๐Ÿš‚/๐ŸŽป &amp; ๐ŸŽ ๐Ÿ“จ ๐Ÿ’ช.
```Python hl_lines="2 14" ```Python hl_lines="2 14"
{!../../../docs_src/custom_response/tutorial007.py!} {!../../docs_src/custom_response/tutorial007.py!}
``` ```
#### โš™๏ธ `StreamingResponse` โฎ๏ธ ๐Ÿ“-๐Ÿ’– ๐ŸŽš #### โš™๏ธ `StreamingResponse` โฎ๏ธ ๐Ÿ“-๐Ÿ’– ๐ŸŽš
@ -238,7 +238,7 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
๐Ÿ‘‰ ๐Ÿ”Œ ๐Ÿ“š ๐Ÿ—ƒ ๐Ÿ”— โฎ๏ธ โ˜ ๐Ÿ’พ, ๐Ÿ“น ๐Ÿญ, &amp; ๐ŸŽ. ๐Ÿ‘‰ ๐Ÿ”Œ ๐Ÿ“š ๐Ÿ—ƒ ๐Ÿ”— โฎ๏ธ โ˜ ๐Ÿ’พ, ๐Ÿ“น ๐Ÿญ, &amp; ๐ŸŽ.
```{ .python .annotate hl_lines="2 10-12 14" } ```{ .python .annotate hl_lines="2 10-12 14" }
{!../../../docs_src/custom_response/tutorial008.py!} {!../../docs_src/custom_response/tutorial008.py!}
``` ```
1๏ธโƒฃ. ๐Ÿ‘‰ ๐Ÿš‚ ๐Ÿ”ข. โšซ๏ธ "๐Ÿš‚ ๐Ÿ”ข" โ†ฉ๏ธ โšซ๏ธ ๐Ÿ”Œ `yield` ๐Ÿ“„ ๐Ÿ”˜. 1๏ธโƒฃ. ๐Ÿ‘‰ ๐Ÿš‚ ๐Ÿ”ข. โšซ๏ธ "๐Ÿš‚ ๐Ÿ”ข" โ†ฉ๏ธ โšซ๏ธ ๐Ÿ”Œ `yield` ๐Ÿ“„ ๐Ÿ”˜.
@ -269,13 +269,13 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
๐Ÿ“ ๐Ÿ“จ ๐Ÿ”œ ๐Ÿ”Œ โ˜‘ `Content-Length`, `Last-Modified` &amp; `ETag` ๐ŸŽš. ๐Ÿ“ ๐Ÿ“จ ๐Ÿ”œ ๐Ÿ”Œ โ˜‘ `Content-Length`, `Last-Modified` &amp; `ETag` ๐ŸŽš.
```Python hl_lines="2 10" ```Python hl_lines="2 10"
{!../../../docs_src/custom_response/tutorial009.py!} {!../../docs_src/custom_response/tutorial009.py!}
``` ```
๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `response_class` ๐Ÿ”ข: ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `response_class` ๐Ÿ”ข:
```Python hl_lines="2 8 10" ```Python hl_lines="2 8 10"
{!../../../docs_src/custom_response/tutorial009b.py!} {!../../docs_src/custom_response/tutorial009b.py!}
``` ```
๐Ÿ‘‰ ๐Ÿ’ผ, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ“ โžก ๐Ÿ”— โšช๏ธโžก๏ธ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ* ๐Ÿ”ข. ๐Ÿ‘‰ ๐Ÿ’ผ, ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ“ โžก ๐Ÿ”— โšช๏ธโžก๏ธ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ* ๐Ÿ”ข.
@ -291,7 +291,7 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
๐Ÿ‘† ๐Ÿ’ช โœ `CustomORJSONResponse`. ๐Ÿ‘‘ ๐Ÿ‘œ ๐Ÿ‘† โœ”๏ธ โœ `Response.render(content)` ๐Ÿ‘ฉโ€๐Ÿ”ฌ ๐Ÿ‘ˆ ๐Ÿ“จ ๐ŸŽš `bytes`: ๐Ÿ‘† ๐Ÿ’ช โœ `CustomORJSONResponse`. ๐Ÿ‘‘ ๐Ÿ‘œ ๐Ÿ‘† โœ”๏ธ โœ `Response.render(content)` ๐Ÿ‘ฉโ€๐Ÿ”ฌ ๐Ÿ‘ˆ ๐Ÿ“จ ๐ŸŽš `bytes`:
```Python hl_lines="9-14 17" ```Python hl_lines="9-14 17"
{!../../../docs_src/custom_response/tutorial009c.py!} {!../../docs_src/custom_response/tutorial009c.py!}
``` ```
๐Ÿ”œ โ†ฉ๏ธ ๐Ÿ›ฌ: ๐Ÿ”œ โ†ฉ๏ธ ๐Ÿ›ฌ:
@ -319,7 +319,7 @@ FastAPI (๐Ÿค™ ๐Ÿ’ƒ) ๐Ÿ”œ ๐Ÿ” ๐Ÿ”Œ ๐ŸŽš-๐Ÿ“ ๐ŸŽš. โšซ๏ธ ๐Ÿ”œ ๐Ÿ”Œ ๐ŸŽš-๐Ÿ†Ž
๐Ÿ–ผ ๐Ÿ”›, **FastAPI** ๐Ÿ”œ โš™๏ธ `ORJSONResponse` ๐Ÿ”ข, ๐ŸŒ *โžก ๐Ÿ› ๏ธ*, โ†ฉ๏ธ `JSONResponse`. ๐Ÿ–ผ ๐Ÿ”›, **FastAPI** ๐Ÿ”œ โš™๏ธ `ORJSONResponse` ๐Ÿ”ข, ๐ŸŒ *โžก ๐Ÿ› ๏ธ*, โ†ฉ๏ธ `JSONResponse`.
```Python hl_lines="2 4" ```Python hl_lines="2 4"
{!../../../docs_src/custom_response/tutorial010.py!} {!../../docs_src/custom_response/tutorial010.py!}
``` ```
/// tip /// tip

6
docs/em/docs/advanced/dataclasses.md

@ -5,7 +5,7 @@ FastAPI ๐Ÿ— ๐Ÿ”› ๐Ÿ” **Pydantic**, &amp; ๐Ÿ‘ค โœ”๏ธ ๐ŸŒ ๐Ÿ‘† โ” โš™๏ธ Pyda
โœ‹๏ธ FastAPI ๐Ÿ•โ€๐Ÿฆบ โš™๏ธ <a href="https://docs.python.org/3/library/dataclasses.html" class="external-link" target="_blank">`dataclasses`</a> ๐ŸŽ ๐ŸŒŒ: โœ‹๏ธ FastAPI ๐Ÿ•โ€๐Ÿฆบ โš™๏ธ <a href="https://docs.python.org/3/library/dataclasses.html" class="external-link" target="_blank">`dataclasses`</a> ๐ŸŽ ๐ŸŒŒ:
```Python hl_lines="1 7-12 19-20" ```Python hl_lines="1 7-12 19-20"
{!../../../docs_src/dataclasses/tutorial001.py!} {!../../docs_src/dataclasses/tutorial001.py!}
``` ```
๐Ÿ‘‰ ๐Ÿ•โ€๐Ÿฆบ ๐Ÿ‘ **Pydantic**, โšซ๏ธ โœ”๏ธ <a href="https://docs.pydantic.dev/latest/concepts/dataclasses/#use-of-stdlib-dataclasses-with-basemodel" class="external-link" target="_blank">๐Ÿ”— ๐Ÿ•โ€๐Ÿฆบ `dataclasses`</a>. ๐Ÿ‘‰ ๐Ÿ•โ€๐Ÿฆบ ๐Ÿ‘ **Pydantic**, โšซ๏ธ โœ”๏ธ <a href="https://docs.pydantic.dev/latest/concepts/dataclasses/#use-of-stdlib-dataclasses-with-basemodel" class="external-link" target="_blank">๐Ÿ”— ๐Ÿ•โ€๐Ÿฆบ `dataclasses`</a>.
@ -35,7 +35,7 @@ FastAPI ๐Ÿ— ๐Ÿ”› ๐Ÿ” **Pydantic**, &amp; ๐Ÿ‘ค โœ”๏ธ ๐ŸŒ ๐Ÿ‘† โ” โš™๏ธ Pyda
๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `dataclasses` `response_model` ๐Ÿ”ข: ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `dataclasses` `response_model` ๐Ÿ”ข:
```Python hl_lines="1 7-13 19" ```Python hl_lines="1 7-13 19"
{!../../../docs_src/dataclasses/tutorial002.py!} {!../../docs_src/dataclasses/tutorial002.py!}
``` ```
๐ŸŽป ๐Ÿ”œ ๐Ÿ” ๐Ÿ—œ Pydantic ๐ŸŽป. ๐ŸŽป ๐Ÿ”œ ๐Ÿ” ๐Ÿ—œ Pydantic ๐ŸŽป.
@ -53,7 +53,7 @@ FastAPI ๐Ÿ— ๐Ÿ”› ๐Ÿ” **Pydantic**, &amp; ๐Ÿ‘ค โœ”๏ธ ๐ŸŒ ๐Ÿ‘† โ” โš™๏ธ Pyda
๐Ÿ‘ˆ ๐Ÿ’ผ, ๐Ÿ‘† ๐Ÿ’ช ๐ŸŽฏ ๐Ÿ’ฑ ๐Ÿฉ `dataclasses` โฎ๏ธ `pydantic.dataclasses`, โ” ๐Ÿ’ง-โ™ป: ๐Ÿ‘ˆ ๐Ÿ’ผ, ๐Ÿ‘† ๐Ÿ’ช ๐ŸŽฏ ๐Ÿ’ฑ ๐Ÿฉ `dataclasses` โฎ๏ธ `pydantic.dataclasses`, โ” ๐Ÿ’ง-โ™ป:
```{ .python .annotate hl_lines="1 5 8-11 14-17 23-25 28" } ```{ .python .annotate hl_lines="1 5 8-11 14-17 23-25 28" }
{!../../../docs_src/dataclasses/tutorial003.py!} {!../../docs_src/dataclasses/tutorial003.py!}
``` ```
1๏ธโƒฃ. ๐Ÿ‘ฅ ๐Ÿ—„ `field` โšช๏ธโžก๏ธ ๐Ÿฉ `dataclasses`. 1๏ธโƒฃ. ๐Ÿ‘ฅ ๐Ÿ—„ `field` โšช๏ธโžก๏ธ ๐Ÿฉ `dataclasses`.

12
docs/em/docs/advanced/events.md

@ -31,7 +31,7 @@
๐Ÿ‘ฅ โœ ๐Ÿ” ๐Ÿ”ข `lifespan()` โฎ๏ธ `yield` ๐Ÿ’– ๐Ÿ‘‰: ๐Ÿ‘ฅ โœ ๐Ÿ” ๐Ÿ”ข `lifespan()` โฎ๏ธ `yield` ๐Ÿ’– ๐Ÿ‘‰:
```Python hl_lines="16 19" ```Python hl_lines="16 19"
{!../../../docs_src/events/tutorial003.py!} {!../../docs_src/events/tutorial003.py!}
``` ```
๐Ÿ“ฅ ๐Ÿ‘ฅ โš– ๐Ÿ˜ฅ *๐Ÿ•ด* ๐Ÿ› ๏ธ ๐Ÿšš ๐Ÿท ๐Ÿšฎ (โŒ) ๐Ÿท ๐Ÿ”ข ๐Ÿ“– โฎ๏ธ ๐ŸŽฐ ๐Ÿซ ๐Ÿท โญ `yield`. ๐Ÿ‘‰ ๐Ÿ“Ÿ ๐Ÿ”œ ๐Ÿ› ๏ธ **โญ** ๐Ÿˆธ **โ–ถ๏ธ โœŠ ๐Ÿ“จ**, โฎ๏ธ *๐Ÿ•ด*. ๐Ÿ“ฅ ๐Ÿ‘ฅ โš– ๐Ÿ˜ฅ *๐Ÿ•ด* ๐Ÿ› ๏ธ ๐Ÿšš ๐Ÿท ๐Ÿšฎ (โŒ) ๐Ÿท ๐Ÿ”ข ๐Ÿ“– โฎ๏ธ ๐ŸŽฐ ๐Ÿซ ๐Ÿท โญ `yield`. ๐Ÿ‘‰ ๐Ÿ“Ÿ ๐Ÿ”œ ๐Ÿ› ๏ธ **โญ** ๐Ÿˆธ **โ–ถ๏ธ โœŠ ๐Ÿ“จ**, โฎ๏ธ *๐Ÿ•ด*.
@ -51,7 +51,7 @@
๐Ÿฅ‡ ๐Ÿ‘œ ๐Ÿ‘€, ๐Ÿ‘ˆ ๐Ÿ‘ฅ โš– ๐Ÿ” ๐Ÿ”ข โฎ๏ธ `yield`. ๐Ÿ‘‰ ๐Ÿ“ถ ๐ŸŽ ๐Ÿ”— โฎ๏ธ `yield`. ๐Ÿฅ‡ ๐Ÿ‘œ ๐Ÿ‘€, ๐Ÿ‘ˆ ๐Ÿ‘ฅ โš– ๐Ÿ” ๐Ÿ”ข โฎ๏ธ `yield`. ๐Ÿ‘‰ ๐Ÿ“ถ ๐ŸŽ ๐Ÿ”— โฎ๏ธ `yield`.
```Python hl_lines="14-19" ```Python hl_lines="14-19"
{!../../../docs_src/events/tutorial003.py!} {!../../docs_src/events/tutorial003.py!}
``` ```
๐Ÿฅ‡ ๐Ÿ• ๐Ÿ”ข, โญ `yield`, ๐Ÿ”œ ๐Ÿ› ๏ธ **โญ** ๐Ÿˆธ โ–ถ๏ธ. ๐Ÿฅ‡ ๐Ÿ• ๐Ÿ”ข, โญ `yield`, ๐Ÿ”œ ๐Ÿ› ๏ธ **โญ** ๐Ÿˆธ โ–ถ๏ธ.
@ -65,7 +65,7 @@
๐Ÿ‘ˆ ๐Ÿ—œ ๐Ÿ”ข ๐Ÿ”˜ ๐Ÿ•ณ ๐Ÿค™ "**๐Ÿ” ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ**". ๐Ÿ‘ˆ ๐Ÿ—œ ๐Ÿ”ข ๐Ÿ”˜ ๐Ÿ•ณ ๐Ÿค™ "**๐Ÿ” ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ**".
```Python hl_lines="1 13" ```Python hl_lines="1 13"
{!../../../docs_src/events/tutorial003.py!} {!../../docs_src/events/tutorial003.py!}
``` ```
**๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ** ๐Ÿ ๐Ÿ•ณ ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `with` ๐Ÿ“„, ๐Ÿ–ผ, `open()` ๐Ÿ’ช โš™๏ธ ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ: **๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ** ๐Ÿ ๐Ÿ•ณ ๐Ÿ‘ˆ ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `with` ๐Ÿ“„, ๐Ÿ–ผ, `open()` ๐Ÿ’ช โš™๏ธ ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ:
@ -89,7 +89,7 @@ async with lifespan(app):
`lifespan` ๐Ÿ”ข `FastAPI` ๐Ÿ“ฑ โœŠ **๐Ÿ” ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ**, ๐Ÿ‘ฅ ๐Ÿ’ช ๐Ÿšถโ€โ™€๏ธ ๐Ÿ‘† ๐Ÿ†• `lifespan` ๐Ÿ” ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ โšซ๏ธ. `lifespan` ๐Ÿ”ข `FastAPI` ๐Ÿ“ฑ โœŠ **๐Ÿ” ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ**, ๐Ÿ‘ฅ ๐Ÿ’ช ๐Ÿšถโ€โ™€๏ธ ๐Ÿ‘† ๐Ÿ†• `lifespan` ๐Ÿ” ๐Ÿ”‘ ๐Ÿ‘จโ€๐Ÿ’ผ โšซ๏ธ.
```Python hl_lines="22" ```Python hl_lines="22"
{!../../../docs_src/events/tutorial003.py!} {!../../docs_src/events/tutorial003.py!}
``` ```
## ๐ŸŽ› ๐ŸŽ‰ (๐Ÿ˜ข) ## ๐ŸŽ› ๐ŸŽ‰ (๐Ÿ˜ข)
@ -113,7 +113,7 @@ async with lifespan(app):
๐Ÿšฎ ๐Ÿ”ข ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿƒ โญ ๐Ÿˆธ โ–ถ๏ธ, ๐Ÿ“ฃ โšซ๏ธ โฎ๏ธ ๐ŸŽ‰ `"startup"`: ๐Ÿšฎ ๐Ÿ”ข ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿƒ โญ ๐Ÿˆธ โ–ถ๏ธ, ๐Ÿ“ฃ โšซ๏ธ โฎ๏ธ ๐ŸŽ‰ `"startup"`:
```Python hl_lines="8" ```Python hl_lines="8"
{!../../../docs_src/events/tutorial001.py!} {!../../docs_src/events/tutorial001.py!}
``` ```
๐Ÿ‘‰ ๐Ÿ’ผ, `startup` ๐ŸŽ‰ ๐Ÿ•โ€๐Ÿฆบ ๐Ÿ”ข ๐Ÿ”œ ๐Ÿ”ข ๐Ÿฌ "๐Ÿ’ฝ" ( `dict`) โฎ๏ธ ๐Ÿ’ฒ. ๐Ÿ‘‰ ๐Ÿ’ผ, `startup` ๐ŸŽ‰ ๐Ÿ•โ€๐Ÿฆบ ๐Ÿ”ข ๐Ÿ”œ ๐Ÿ”ข ๐Ÿฌ "๐Ÿ’ฝ" ( `dict`) โฎ๏ธ ๐Ÿ’ฒ.
@ -127,7 +127,7 @@ async with lifespan(app):
๐Ÿšฎ ๐Ÿ”ข ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿƒ ๐Ÿ•โ” ๐Ÿˆธ ๐Ÿคซ ๐Ÿ”ฝ, ๐Ÿ“ฃ โšซ๏ธ โฎ๏ธ ๐ŸŽ‰ `"shutdown"`: ๐Ÿšฎ ๐Ÿ”ข ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿƒ ๐Ÿ•โ” ๐Ÿˆธ ๐Ÿคซ ๐Ÿ”ฝ, ๐Ÿ“ฃ โšซ๏ธ โฎ๏ธ ๐ŸŽ‰ `"shutdown"`:
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/events/tutorial002.py!} {!../../docs_src/events/tutorial002.py!}
``` ```
๐Ÿ“ฅ, `shutdown` ๐ŸŽ‰ ๐Ÿ•โ€๐Ÿฆบ ๐Ÿ”ข ๐Ÿ”œ โœ โœ โธ `"Application shutdown"` ๐Ÿ“ `log.txt`. ๐Ÿ“ฅ, `shutdown` ๐ŸŽ‰ ๐Ÿ•โ€๐Ÿฆบ ๐Ÿ”ข ๐Ÿ”œ โœ โœ โธ `"Application shutdown"` ๐Ÿ“ `log.txt`.

14
docs/em/docs/advanced/generate-clients.md

@ -19,7 +19,7 @@
//// tab | ๐Ÿ 3๏ธโƒฃ.6๏ธโƒฃ &amp; ๐Ÿ”› //// tab | ๐Ÿ 3๏ธโƒฃ.6๏ธโƒฃ &amp; ๐Ÿ”›
```Python hl_lines="9-11 14-15 18 19 23" ```Python hl_lines="9-11 14-15 18 19 23"
{!> ../../../docs_src/generate_clients/tutorial001.py!} {!> ../../docs_src/generate_clients/tutorial001.py!}
``` ```
//// ////
@ -27,7 +27,7 @@
//// tab | ๐Ÿ 3๏ธโƒฃ.9๏ธโƒฃ &amp; ๐Ÿ”› //// tab | ๐Ÿ 3๏ธโƒฃ.9๏ธโƒฃ &amp; ๐Ÿ”›
```Python hl_lines="7-9 12-13 16-17 21" ```Python hl_lines="7-9 12-13 16-17 21"
{!> ../../../docs_src/generate_clients/tutorial001_py39.py!} {!> ../../docs_src/generate_clients/tutorial001_py39.py!}
``` ```
//// ////
@ -139,7 +139,7 @@ [email protected] generate-client /home/user/code/frontend-app
//// tab | ๐Ÿ 3๏ธโƒฃ.6๏ธโƒฃ &amp; ๐Ÿ”› //// tab | ๐Ÿ 3๏ธโƒฃ.6๏ธโƒฃ &amp; ๐Ÿ”›
```Python hl_lines="23 28 36" ```Python hl_lines="23 28 36"
{!> ../../../docs_src/generate_clients/tutorial002.py!} {!> ../../docs_src/generate_clients/tutorial002.py!}
``` ```
//// ////
@ -147,7 +147,7 @@ [email protected] generate-client /home/user/code/frontend-app
//// tab | ๐Ÿ 3๏ธโƒฃ.9๏ธโƒฃ &amp; ๐Ÿ”› //// tab | ๐Ÿ 3๏ธโƒฃ.9๏ธโƒฃ &amp; ๐Ÿ”›
```Python hl_lines="21 26 34" ```Python hl_lines="21 26 34"
{!> ../../../docs_src/generate_clients/tutorial002_py39.py!} {!> ../../docs_src/generate_clients/tutorial002_py39.py!}
``` ```
//// ////
@ -200,7 +200,7 @@ FastAPI โš™๏ธ **๐Ÿ˜ ๐Ÿ†”** ๐Ÿ”  *โžก ๐Ÿ› ๏ธ*, โšซ๏ธ โš™๏ธ **๐Ÿ› ๏ธ ๐Ÿ†”**
//// tab | ๐Ÿ 3๏ธโƒฃ.6๏ธโƒฃ &amp; ๐Ÿ”› //// tab | ๐Ÿ 3๏ธโƒฃ.6๏ธโƒฃ &amp; ๐Ÿ”›
```Python hl_lines="8-9 12" ```Python hl_lines="8-9 12"
{!> ../../../docs_src/generate_clients/tutorial003.py!} {!> ../../docs_src/generate_clients/tutorial003.py!}
``` ```
//// ////
@ -208,7 +208,7 @@ FastAPI โš™๏ธ **๐Ÿ˜ ๐Ÿ†”** ๐Ÿ”  *โžก ๐Ÿ› ๏ธ*, โšซ๏ธ โš™๏ธ **๐Ÿ› ๏ธ ๐Ÿ†”**
//// tab | ๐Ÿ 3๏ธโƒฃ.9๏ธโƒฃ &amp; ๐Ÿ”› //// tab | ๐Ÿ 3๏ธโƒฃ.9๏ธโƒฃ &amp; ๐Ÿ”›
```Python hl_lines="6-7 10" ```Python hl_lines="6-7 10"
{!> ../../../docs_src/generate_clients/tutorial003_py39.py!} {!> ../../docs_src/generate_clients/tutorial003_py39.py!}
``` ```
//// ////
@ -234,7 +234,7 @@ FastAPI โš™๏ธ **๐Ÿ˜ ๐Ÿ†”** ๐Ÿ”  *โžก ๐Ÿ› ๏ธ*, โšซ๏ธ โš™๏ธ **๐Ÿ› ๏ธ ๐Ÿ†”**
๐Ÿ‘ฅ ๐Ÿ’ช โฌ ๐Ÿ—„ ๐ŸŽป ๐Ÿ“ `openapi.json` &amp; โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช **โŽ ๐Ÿ‘ˆ ๐Ÿ”ก ๐Ÿ”–** โฎ๏ธ โœ ๐Ÿ’– ๐Ÿ‘‰: ๐Ÿ‘ฅ ๐Ÿ’ช โฌ ๐Ÿ—„ ๐ŸŽป ๐Ÿ“ `openapi.json` &amp; โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช **โŽ ๐Ÿ‘ˆ ๐Ÿ”ก ๐Ÿ”–** โฎ๏ธ โœ ๐Ÿ’– ๐Ÿ‘‰:
```Python ```Python
{!../../../docs_src/generate_clients/tutorial004.py!} {!../../docs_src/generate_clients/tutorial004.py!}
``` ```
โฎ๏ธ ๐Ÿ‘ˆ, ๐Ÿ› ๏ธ ๐Ÿ†” ๐Ÿ”œ ๐Ÿ“ โšช๏ธโžก๏ธ ๐Ÿ‘œ ๐Ÿ’– `items-get_items` `get_items`, ๐Ÿ‘ˆ ๐ŸŒŒ ๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿš‚ ๐Ÿ’ช ๐Ÿ— ๐Ÿ™… ๐Ÿ‘ฉโ€๐Ÿ”ฌ ๐Ÿ“›. โฎ๏ธ ๐Ÿ‘ˆ, ๐Ÿ› ๏ธ ๐Ÿ†” ๐Ÿ”œ ๐Ÿ“ โšช๏ธโžก๏ธ ๐Ÿ‘œ ๐Ÿ’– `items-get_items` `get_items`, ๐Ÿ‘ˆ ๐ŸŒŒ ๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿš‚ ๐Ÿ’ช ๐Ÿ— ๐Ÿ™… ๐Ÿ‘ฉโ€๐Ÿ”ฌ ๐Ÿ“›.

6
docs/em/docs/advanced/middleware.md

@ -58,7 +58,7 @@ app.add_middleware(UnicornMiddleware, some_config="rainbow")
๐Ÿ™† ๐Ÿ“จ ๐Ÿ“จ `http` โš–๏ธ `ws` ๐Ÿ”œ โŽ ๐Ÿ” โš– โ†ฉ๏ธ. ๐Ÿ™† ๐Ÿ“จ ๐Ÿ“จ `http` โš–๏ธ `ws` ๐Ÿ”œ โŽ ๐Ÿ” โš– โ†ฉ๏ธ.
```Python hl_lines="2 6" ```Python hl_lines="2 6"
{!../../../docs_src/advanced_middleware/tutorial001.py!} {!../../docs_src/advanced_middleware/tutorial001.py!}
``` ```
## `TrustedHostMiddleware` ## `TrustedHostMiddleware`
@ -66,7 +66,7 @@ app.add_middleware(UnicornMiddleware, some_config="rainbow")
๐Ÿ› ๏ธ ๐Ÿ‘ˆ ๐ŸŒ ๐Ÿ“จ ๐Ÿ“จ โœ”๏ธ โ˜‘ โš’ `Host` ๐ŸŽš, โœ” ๐Ÿ’‚โ€โ™‚ ๐Ÿ›ก ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ” ๐Ÿฆ  ๐ŸŽš ๐Ÿ‘Š. ๐Ÿ› ๏ธ ๐Ÿ‘ˆ ๐ŸŒ ๐Ÿ“จ ๐Ÿ“จ โœ”๏ธ โ˜‘ โš’ `Host` ๐ŸŽš, โœ” ๐Ÿ’‚โ€โ™‚ ๐Ÿ›ก ๐Ÿ‡บ๐Ÿ‡ธ๐Ÿ” ๐Ÿฆ  ๐ŸŽš ๐Ÿ‘Š.
```Python hl_lines="2 6-8" ```Python hl_lines="2 6-8"
{!../../../docs_src/advanced_middleware/tutorial002.py!} {!../../docs_src/advanced_middleware/tutorial002.py!}
``` ```
๐Ÿ“„ โŒ ๐Ÿ•โ€๐Ÿฆบ: ๐Ÿ“„ โŒ ๐Ÿ•โ€๐Ÿฆบ:
@ -82,7 +82,7 @@ app.add_middleware(UnicornMiddleware, some_config="rainbow")
๐Ÿ› ๏ธ ๐Ÿ”œ ๐Ÿต ๐Ÿ‘ฏโ€โ™‚๏ธ ๐Ÿฉ &amp; ๐ŸŽฅ ๐Ÿ“จ. ๐Ÿ› ๏ธ ๐Ÿ”œ ๐Ÿต ๐Ÿ‘ฏโ€โ™‚๏ธ ๐Ÿฉ &amp; ๐ŸŽฅ ๐Ÿ“จ.
```Python hl_lines="2 6" ```Python hl_lines="2 6"
{!../../../docs_src/advanced_middleware/tutorial003.py!} {!../../docs_src/advanced_middleware/tutorial003.py!}
``` ```
๐Ÿ“„ โŒ ๐Ÿ•โ€๐Ÿฆบ: ๐Ÿ“„ โŒ ๐Ÿ•โ€๐Ÿฆบ:

8
docs/em/docs/advanced/openapi-callbacks.md

@ -32,7 +32,7 @@
๐Ÿ‘‰ ๐Ÿ• ๐Ÿ“ถ ๐Ÿ˜, ๐ŸŒ… ๐Ÿ“Ÿ ๐ŸŽฒ โช ๐Ÿ˜ฐ ๐Ÿ‘†: ๐Ÿ‘‰ ๐Ÿ• ๐Ÿ“ถ ๐Ÿ˜, ๐ŸŒ… ๐Ÿ“Ÿ ๐ŸŽฒ โช ๐Ÿ˜ฐ ๐Ÿ‘†:
```Python hl_lines="9-13 36-53" ```Python hl_lines="9-13 36-53"
{!../../../docs_src/openapi_callbacks/tutorial001.py!} {!../../docs_src/openapi_callbacks/tutorial001.py!}
``` ```
/// tip /// tip
@ -93,7 +93,7 @@ httpx.post(callback_url, json={"description": "Invoice paid", "paid": True})
๐Ÿฅ‡ โœ ๐Ÿ†• `APIRouter` ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿ”Œ 1๏ธโƒฃ โš–๏ธ ๐ŸŒ… โฒ. ๐Ÿฅ‡ โœ ๐Ÿ†• `APIRouter` ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿ”Œ 1๏ธโƒฃ โš–๏ธ ๐ŸŒ… โฒ.
```Python hl_lines="3 25" ```Python hl_lines="3 25"
{!../../../docs_src/openapi_callbacks/tutorial001.py!} {!../../docs_src/openapi_callbacks/tutorial001.py!}
``` ```
### โœ โฒ *โžก ๐Ÿ› ๏ธ* ### โœ โฒ *โžก ๐Ÿ› ๏ธ*
@ -106,7 +106,7 @@ httpx.post(callback_url, json={"description": "Invoice paid", "paid": True})
* &amp; โšซ๏ธ ๐Ÿ’ช โœ”๏ธ ๐Ÿ“„ ๐Ÿ“จ โšซ๏ธ ๐Ÿ”œ ๐Ÿ“จ, โœ… `response_model=InvoiceEventReceived`. * &amp; โšซ๏ธ ๐Ÿ’ช โœ”๏ธ ๐Ÿ“„ ๐Ÿ“จ โšซ๏ธ ๐Ÿ”œ ๐Ÿ“จ, โœ… `response_model=InvoiceEventReceived`.
```Python hl_lines="16-18 21-22 28-32" ```Python hl_lines="16-18 21-22 28-32"
{!../../../docs_src/openapi_callbacks/tutorial001.py!} {!../../docs_src/openapi_callbacks/tutorial001.py!}
``` ```
๐Ÿ“ค 2๏ธโƒฃ ๐Ÿ‘‘ ๐Ÿ”บ โšช๏ธโžก๏ธ ๐Ÿ˜ *โžก ๐Ÿ› ๏ธ*: ๐Ÿ“ค 2๏ธโƒฃ ๐Ÿ‘‘ ๐Ÿ”บ โšช๏ธโžก๏ธ ๐Ÿ˜ *โžก ๐Ÿ› ๏ธ*:
@ -176,7 +176,7 @@ https://www.external.org/events/invoices/2expen51ve
๐Ÿ”œ โš™๏ธ ๐Ÿ”ข `callbacks` *๐Ÿ‘† ๐Ÿ› ๏ธ โžก ๐Ÿ› ๏ธ ๐Ÿ‘จโ€๐ŸŽจ* ๐Ÿšถโ€โ™€๏ธ ๐Ÿ”ข `.routes` (๐Ÿ‘ˆ ๐Ÿค™ `list` ๐Ÿ›ฃ/*โžก ๐Ÿ› ๏ธ*) โšช๏ธโžก๏ธ ๐Ÿ‘ˆ โฒ ๐Ÿ“ป: ๐Ÿ”œ โš™๏ธ ๐Ÿ”ข `callbacks` *๐Ÿ‘† ๐Ÿ› ๏ธ โžก ๐Ÿ› ๏ธ ๐Ÿ‘จโ€๐ŸŽจ* ๐Ÿšถโ€โ™€๏ธ ๐Ÿ”ข `.routes` (๐Ÿ‘ˆ ๐Ÿค™ `list` ๐Ÿ›ฃ/*โžก ๐Ÿ› ๏ธ*) โšช๏ธโžก๏ธ ๐Ÿ‘ˆ โฒ ๐Ÿ“ป:
```Python hl_lines="35" ```Python hl_lines="35"
{!../../../docs_src/openapi_callbacks/tutorial001.py!} {!../../docs_src/openapi_callbacks/tutorial001.py!}
``` ```
/// tip /// tip

16
docs/em/docs/advanced/path-operation-advanced-configuration.md

@ -13,7 +13,7 @@
๐Ÿ‘† ๐Ÿ”œ โœ”๏ธ โš’ ๐Ÿ’ญ ๐Ÿ‘ˆ โšซ๏ธ ๐Ÿ˜ ๐Ÿ”  ๐Ÿ› ๏ธ. ๐Ÿ‘† ๐Ÿ”œ โœ”๏ธ โš’ ๐Ÿ’ญ ๐Ÿ‘ˆ โšซ๏ธ ๐Ÿ˜ ๐Ÿ”  ๐Ÿ› ๏ธ.
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial001.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial001.py!}
``` ```
### โš™๏ธ *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿ“› { ### โš™๏ธ *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿ“› {
@ -23,7 +23,7 @@
๐Ÿ‘† ๐Ÿ”œ โšซ๏ธ โฎ๏ธ โŽ ๐ŸŒ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ*. ๐Ÿ‘† ๐Ÿ”œ โšซ๏ธ โฎ๏ธ โŽ ๐ŸŒ ๐Ÿ‘† *โžก ๐Ÿ› ๏ธ*.
```Python hl_lines="2 12-21 24" ```Python hl_lines="2 12-21 24"
{!../../../docs_src/path_operation_advanced_configuration/tutorial002.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial002.py!}
``` ```
/// tip /// tip
@ -45,7 +45,7 @@
๐Ÿšซ *โžก ๐Ÿ› ๏ธ* โšช๏ธโžก๏ธ ๐Ÿ— ๐Ÿ—„ ๐Ÿ”— (&amp; โžก๏ธ, โšช๏ธโžก๏ธ ๐Ÿง ๐Ÿงพ โš™๏ธ), โš™๏ธ ๐Ÿ”ข `include_in_schema` &amp; โš’ โšซ๏ธ `False`: ๐Ÿšซ *โžก ๐Ÿ› ๏ธ* โšช๏ธโžก๏ธ ๐Ÿ— ๐Ÿ—„ ๐Ÿ”— (&amp; โžก๏ธ, โšช๏ธโžก๏ธ ๐Ÿง ๐Ÿงพ โš™๏ธ), โš™๏ธ ๐Ÿ”ข `include_in_schema` &amp; โš’ โšซ๏ธ `False`:
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial003.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial003.py!}
``` ```
## ๐Ÿง ๐Ÿ“› โšช๏ธโžก๏ธ #๏ธโƒฃ ## ๐Ÿง ๐Ÿ“› โšช๏ธโžก๏ธ #๏ธโƒฃ
@ -57,7 +57,7 @@
โšซ๏ธ ๐Ÿ† ๐Ÿšซ ๐ŸŽฆ ๐Ÿ†™ ๐Ÿงพ, โœ‹๏ธ ๐ŸŽ ๐Ÿงฐ (โœ… ๐Ÿ‰) ๐Ÿ”œ ๐Ÿ’ช โš™๏ธ ๐ŸŽ‚. โšซ๏ธ ๐Ÿ† ๐Ÿšซ ๐ŸŽฆ ๐Ÿ†™ ๐Ÿงพ, โœ‹๏ธ ๐ŸŽ ๐Ÿงฐ (โœ… ๐Ÿ‰) ๐Ÿ”œ ๐Ÿ’ช โš™๏ธ ๐ŸŽ‚.
```Python hl_lines="19-29" ```Python hl_lines="19-29"
{!../../../docs_src/path_operation_advanced_configuration/tutorial004.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial004.py!}
``` ```
## ๐ŸŒ– ๐Ÿ“จ ## ๐ŸŒ– ๐Ÿ“จ
@ -101,7 +101,7 @@
๐Ÿ‘‰ `openapi_extra` ๐Ÿ’ช ๐Ÿ‘, ๐Ÿ–ผ, ๐Ÿ“ฃ [๐Ÿ—„ โ†”](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specificationExtensions): ๐Ÿ‘‰ `openapi_extra` ๐Ÿ’ช ๐Ÿ‘, ๐Ÿ–ผ, ๐Ÿ“ฃ [๐Ÿ—„ โ†”](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specificationExtensions):
```Python hl_lines="6" ```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial005.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial005.py!}
``` ```
๐Ÿšฅ ๐Ÿ‘† ๐Ÿ“‚ ๐Ÿง ๐Ÿ› ๏ธ ๐Ÿฉบ, ๐Ÿ‘† โ†” ๐Ÿ”œ ๐ŸŽฆ ๐Ÿ†™ ๐Ÿ” ๐ŸŽฏ *โžก ๐Ÿ› ๏ธ*. ๐Ÿšฅ ๐Ÿ‘† ๐Ÿ“‚ ๐Ÿง ๐Ÿ› ๏ธ ๐Ÿฉบ, ๐Ÿ‘† โ†” ๐Ÿ”œ ๐ŸŽฆ ๐Ÿ†™ ๐Ÿ” ๐ŸŽฏ *โžก ๐Ÿ› ๏ธ*.
@ -150,7 +150,7 @@
๐Ÿ‘† ๐Ÿ’ช ๐Ÿ‘ˆ โฎ๏ธ `openapi_extra`: ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ‘ˆ โฎ๏ธ `openapi_extra`:
```Python hl_lines="20-37 39-40" ```Python hl_lines="20-37 39-40"
{!../../../docs_src/path_operation_advanced_configuration/tutorial006.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial006.py!}
``` ```
๐Ÿ‘‰ ๐Ÿ–ผ, ๐Ÿ‘ฅ ๐Ÿšซ ๐Ÿ“ฃ ๐Ÿ™† Pydantic ๐Ÿท. ๐Ÿ‘, ๐Ÿ“จ ๐Ÿ’ช ๐Ÿšซ <abbr title="converted from some plain format, like bytes, into Python objects">๐ŸŽป</abbr> ๐ŸŽป, โšซ๏ธ โœ ๐Ÿ”— `bytes`, &amp; ๐Ÿ”ข `magic_data_reader()` ๐Ÿ”œ ๐Ÿˆš ๐ŸŽป โšซ๏ธ ๐ŸŒŒ. ๐Ÿ‘‰ ๐Ÿ–ผ, ๐Ÿ‘ฅ ๐Ÿšซ ๐Ÿ“ฃ ๐Ÿ™† Pydantic ๐Ÿท. ๐Ÿ‘, ๐Ÿ“จ ๐Ÿ’ช ๐Ÿšซ <abbr title="converted from some plain format, like bytes, into Python objects">๐ŸŽป</abbr> ๐ŸŽป, โšซ๏ธ โœ ๐Ÿ”— `bytes`, &amp; ๐Ÿ”ข `magic_data_reader()` ๐Ÿ”œ ๐Ÿˆš ๐ŸŽป โšซ๏ธ ๐ŸŒŒ.
@ -166,7 +166,7 @@
๐Ÿ–ผ, ๐Ÿ‘‰ ๐Ÿˆธ ๐Ÿ‘ฅ ๐Ÿšซ โš™๏ธ FastAPI ๐Ÿ› ๏ธ ๐Ÿ› ๏ธ โš— ๐ŸŽป ๐Ÿ”— โšช๏ธโžก๏ธ Pydantic ๐Ÿท ๐Ÿšซ ๐Ÿง ๐Ÿ”ฌ ๐ŸŽป. ๐Ÿ‘, ๐Ÿ‘ฅ ๐Ÿ“ฃ ๐Ÿ“จ ๐ŸŽš ๐Ÿ†Ž ๐Ÿ“, ๐Ÿšซ ๐ŸŽป: ๐Ÿ–ผ, ๐Ÿ‘‰ ๐Ÿˆธ ๐Ÿ‘ฅ ๐Ÿšซ โš™๏ธ FastAPI ๐Ÿ› ๏ธ ๐Ÿ› ๏ธ โš— ๐ŸŽป ๐Ÿ”— โšช๏ธโžก๏ธ Pydantic ๐Ÿท ๐Ÿšซ ๐Ÿง ๐Ÿ”ฌ ๐ŸŽป. ๐Ÿ‘, ๐Ÿ‘ฅ ๐Ÿ“ฃ ๐Ÿ“จ ๐ŸŽš ๐Ÿ†Ž ๐Ÿ“, ๐Ÿšซ ๐ŸŽป:
```Python hl_lines="17-22 24" ```Python hl_lines="17-22 24"
{!../../../docs_src/path_operation_advanced_configuration/tutorial007.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
``` ```
๐Ÿ‘, ๐Ÿ‘ ๐Ÿ‘ฅ ๐Ÿšซ โš™๏ธ ๐Ÿ”ข ๐Ÿ› ๏ธ ๐Ÿ› ๏ธ, ๐Ÿ‘ฅ โš™๏ธ Pydantic ๐Ÿท โŽ ๐Ÿ— ๐ŸŽป ๐Ÿ”— ๐Ÿ’ฝ ๐Ÿ‘ˆ ๐Ÿ‘ฅ ๐Ÿ’š ๐Ÿ“จ ๐Ÿ“. ๐Ÿ‘, ๐Ÿ‘ ๐Ÿ‘ฅ ๐Ÿšซ โš™๏ธ ๐Ÿ”ข ๐Ÿ› ๏ธ ๐Ÿ› ๏ธ, ๐Ÿ‘ฅ โš™๏ธ Pydantic ๐Ÿท โŽ ๐Ÿ— ๐ŸŽป ๐Ÿ”— ๐Ÿ’ฝ ๐Ÿ‘ˆ ๐Ÿ‘ฅ ๐Ÿ’š ๐Ÿ“จ ๐Ÿ“.
@ -176,7 +176,7 @@
&amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ“Ÿ, ๐Ÿ‘ฅ ๐ŸŽป ๐Ÿ‘ˆ ๐Ÿ“ ๐ŸŽš ๐Ÿ”—, &amp; โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ”„ โš™๏ธ ๐ŸŽ Pydantic ๐Ÿท โœ” ๐Ÿ“ ๐ŸŽš: &amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ“Ÿ, ๐Ÿ‘ฅ ๐ŸŽป ๐Ÿ‘ˆ ๐Ÿ“ ๐ŸŽš ๐Ÿ”—, &amp; โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ”„ โš™๏ธ ๐ŸŽ Pydantic ๐Ÿท โœ” ๐Ÿ“ ๐ŸŽš:
```Python hl_lines="26-33" ```Python hl_lines="26-33"
{!../../../docs_src/path_operation_advanced_configuration/tutorial007.py!} {!../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
``` ```
/// tip /// tip

2
docs/em/docs/advanced/response-change-status-code.md

@ -21,7 +21,7 @@
&amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โš’ `status_code` ๐Ÿ‘ˆ *๐Ÿ”€* ๐Ÿ“จ ๐ŸŽš. &amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โš’ `status_code` ๐Ÿ‘ˆ *๐Ÿ”€* ๐Ÿ“จ ๐ŸŽš.
```Python hl_lines="1 9 12" ```Python hl_lines="1 9 12"
{!../../../docs_src/response_change_status_code/tutorial001.py!} {!../../docs_src/response_change_status_code/tutorial001.py!}
``` ```
&amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ™† ๐ŸŽš ๐Ÿ‘† ๐Ÿ’ช, ๐Ÿ‘† ๐Ÿ›Ž ๐Ÿ”œ ( `dict`, ๐Ÿ’ฝ ๐Ÿท, โ™’๏ธ). &amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ™† ๐ŸŽš ๐Ÿ‘† ๐Ÿ’ช, ๐Ÿ‘† ๐Ÿ›Ž ๐Ÿ”œ ( `dict`, ๐Ÿ’ฝ ๐Ÿท, โ™’๏ธ).

4
docs/em/docs/advanced/response-cookies.md

@ -7,7 +7,7 @@
&amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โš’ ๐Ÿช ๐Ÿ‘ˆ *๐Ÿ”€* ๐Ÿ“จ ๐ŸŽš. &amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โš’ ๐Ÿช ๐Ÿ‘ˆ *๐Ÿ”€* ๐Ÿ“จ ๐ŸŽš.
```Python hl_lines="1 8-9" ```Python hl_lines="1 8-9"
{!../../../docs_src/response_cookies/tutorial002.py!} {!../../docs_src/response_cookies/tutorial002.py!}
``` ```
&amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ™† ๐ŸŽš ๐Ÿ‘† ๐Ÿ’ช, ๐Ÿ‘† ๐Ÿ›Ž ๐Ÿ”œ ( `dict`, ๐Ÿ’ฝ ๐Ÿท, โ™’๏ธ). &amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ™† ๐ŸŽš ๐Ÿ‘† ๐Ÿ’ช, ๐Ÿ‘† ๐Ÿ›Ž ๐Ÿ”œ ( `dict`, ๐Ÿ’ฝ ๐Ÿท, โ™’๏ธ).
@ -27,7 +27,7 @@
โคด๏ธ โš’ ๐Ÿช โšซ๏ธ, &amp; โคด๏ธ ๐Ÿ“จ โšซ๏ธ: โคด๏ธ โš’ ๐Ÿช โšซ๏ธ, &amp; โคด๏ธ ๐Ÿ“จ โšซ๏ธ:
```Python hl_lines="10-12" ```Python hl_lines="10-12"
{!../../../docs_src/response_cookies/tutorial001.py!} {!../../docs_src/response_cookies/tutorial001.py!}
``` ```
/// tip /// tip

4
docs/em/docs/advanced/response-directly.md

@ -35,7 +35,7 @@
๐Ÿ“š ๐Ÿ’ผ, ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `jsonable_encoder` ๐Ÿ—œ ๐Ÿ‘† ๐Ÿ“Š โญ ๐Ÿšถโ€โ™€๏ธ โšซ๏ธ ๐Ÿ“จ: ๐Ÿ“š ๐Ÿ’ผ, ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `jsonable_encoder` ๐Ÿ—œ ๐Ÿ‘† ๐Ÿ“Š โญ ๐Ÿšถโ€โ™€๏ธ โšซ๏ธ ๐Ÿ“จ:
```Python hl_lines="6-7 21-22" ```Python hl_lines="6-7 21-22"
{!../../../docs_src/response_directly/tutorial001.py!} {!../../docs_src/response_directly/tutorial001.py!}
``` ```
/// note | "๐Ÿ“ก โ„น" /// note | "๐Ÿ“ก โ„น"
@ -57,7 +57,7 @@
๐Ÿ‘† ๐Ÿ’ช ๐Ÿšฎ ๐Ÿ‘† ๐Ÿ“‚ ๐ŸŽš ๐ŸŽป, ๐Ÿšฎ โšซ๏ธ `Response`, &amp; ๐Ÿ“จ โšซ๏ธ: ๐Ÿ‘† ๐Ÿ’ช ๐Ÿšฎ ๐Ÿ‘† ๐Ÿ“‚ ๐ŸŽš ๐ŸŽป, ๐Ÿšฎ โšซ๏ธ `Response`, &amp; ๐Ÿ“จ โšซ๏ธ:
```Python hl_lines="1 18" ```Python hl_lines="1 18"
{!../../../docs_src/response_directly/tutorial002.py!} {!../../docs_src/response_directly/tutorial002.py!}
``` ```
## ๐Ÿ—’ ## ๐Ÿ—’

4
docs/em/docs/advanced/response-headers.md

@ -7,7 +7,7 @@
&amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โš’ ๐ŸŽš ๐Ÿ‘ˆ *๐Ÿ”€* ๐Ÿ“จ ๐ŸŽš. &amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โš’ ๐ŸŽš ๐Ÿ‘ˆ *๐Ÿ”€* ๐Ÿ“จ ๐ŸŽš.
```Python hl_lines="1 7-8" ```Python hl_lines="1 7-8"
{!../../../docs_src/response_headers/tutorial002.py!} {!../../docs_src/response_headers/tutorial002.py!}
``` ```
&amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ™† ๐ŸŽš ๐Ÿ‘† ๐Ÿ’ช, ๐Ÿ‘† ๐Ÿ›Ž ๐Ÿ”œ ( `dict`, ๐Ÿ’ฝ ๐Ÿท, โ™’๏ธ). &amp; โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ™† ๐ŸŽš ๐Ÿ‘† ๐Ÿ’ช, ๐Ÿ‘† ๐Ÿ›Ž ๐Ÿ”œ ( `dict`, ๐Ÿ’ฝ ๐Ÿท, โ™’๏ธ).
@ -25,7 +25,7 @@
โœ ๐Ÿ“จ ๐Ÿ”ฌ [๐Ÿ“จ ๐Ÿ“จ ๐Ÿ”—](response-directly.md){.internal-link target=_blank} &amp; ๐Ÿšถโ€โ™€๏ธ ๐ŸŽš ๐ŸŒ– ๐Ÿ”ข: โœ ๐Ÿ“จ ๐Ÿ”ฌ [๐Ÿ“จ ๐Ÿ“จ ๐Ÿ”—](response-directly.md){.internal-link target=_blank} &amp; ๐Ÿšถโ€โ™€๏ธ ๐ŸŽš ๐ŸŒ– ๐Ÿ”ข:
```Python hl_lines="10-12" ```Python hl_lines="10-12"
{!../../../docs_src/response_headers/tutorial001.py!} {!../../docs_src/response_headers/tutorial001.py!}
``` ```
/// note | "๐Ÿ“ก โ„น" /// note | "๐Ÿ“ก โ„น"

6
docs/em/docs/advanced/security/http-basic-auth.md

@ -21,7 +21,7 @@
* โšซ๏ธ ๐Ÿ”Œ `username` &amp; `password` ๐Ÿ“จ. * โšซ๏ธ ๐Ÿ”Œ `username` &amp; `password` ๐Ÿ“จ.
```Python hl_lines="2 6 10" ```Python hl_lines="2 6 10"
{!../../../docs_src/security/tutorial006.py!} {!../../docs_src/security/tutorial006.py!}
``` ```
๐Ÿ•โ” ๐Ÿ‘† ๐Ÿ”„ ๐Ÿ“‚ ๐Ÿ“› ๐Ÿฅ‡ ๐Ÿ•ฐ (โš–๏ธ ๐Ÿ–Š "๐Ÿ› ๏ธ" ๐Ÿ”ผ ๐Ÿฉบ) ๐Ÿ–ฅ ๐Ÿ”œ ๐Ÿ’ญ ๐Ÿ‘† ๐Ÿ‘† ๐Ÿ†” &amp; ๐Ÿ”: ๐Ÿ•โ” ๐Ÿ‘† ๐Ÿ”„ ๐Ÿ“‚ ๐Ÿ“› ๐Ÿฅ‡ ๐Ÿ•ฐ (โš–๏ธ ๐Ÿ–Š "๐Ÿ› ๏ธ" ๐Ÿ”ผ ๐Ÿฉบ) ๐Ÿ–ฅ ๐Ÿ”œ ๐Ÿ’ญ ๐Ÿ‘† ๐Ÿ‘† ๐Ÿ†” &amp; ๐Ÿ”:
@ -43,7 +43,7 @@
โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช โš™๏ธ `secrets.compare_digest()` ๐Ÿšš ๐Ÿ‘ˆ `credentials.username` `"stanleyjobson"`, &amp; ๐Ÿ‘ˆ `credentials.password` `"swordfish"`. โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช โš™๏ธ `secrets.compare_digest()` ๐Ÿšš ๐Ÿ‘ˆ `credentials.username` `"stanleyjobson"`, &amp; ๐Ÿ‘ˆ `credentials.password` `"swordfish"`.
```Python hl_lines="1 11-21" ```Python hl_lines="1 11-21"
{!../../../docs_src/security/tutorial007.py!} {!../../docs_src/security/tutorial007.py!}
``` ```
๐Ÿ‘‰ ๐Ÿ”œ ๐ŸŽ: ๐Ÿ‘‰ ๐Ÿ”œ ๐ŸŽ:
@ -109,5 +109,5 @@ if "stanleyjobsox" == "stanleyjobson" and "love123" == "swordfish":
โฎ๏ธ ๐Ÿ” ๐Ÿ‘ˆ ๐ŸŽ“ โŒ, ๐Ÿ“จ `HTTPException` โฎ๏ธ ๐Ÿ‘” ๐Ÿ“Ÿ 4๏ธโƒฃ0๏ธโƒฃ1๏ธโƒฃ (๐ŸŽ ๐Ÿ“จ ๐Ÿ•โ” ๐Ÿ™…โ€โ™‚ ๐ŸŽ“ ๐Ÿšš) &amp; ๐Ÿšฎ ๐ŸŽš `WWW-Authenticate` โš’ ๐Ÿ–ฅ ๐ŸŽฆ ๐Ÿ’ณ ๐Ÿ“‹ ๐Ÿ”„: โฎ๏ธ ๐Ÿ” ๐Ÿ‘ˆ ๐ŸŽ“ โŒ, ๐Ÿ“จ `HTTPException` โฎ๏ธ ๐Ÿ‘” ๐Ÿ“Ÿ 4๏ธโƒฃ0๏ธโƒฃ1๏ธโƒฃ (๐ŸŽ ๐Ÿ“จ ๐Ÿ•โ” ๐Ÿ™…โ€โ™‚ ๐ŸŽ“ ๐Ÿšš) &amp; ๐Ÿšฎ ๐ŸŽš `WWW-Authenticate` โš’ ๐Ÿ–ฅ ๐ŸŽฆ ๐Ÿ’ณ ๐Ÿ“‹ ๐Ÿ”„:
```Python hl_lines="23-27" ```Python hl_lines="23-27"
{!../../../docs_src/security/tutorial007.py!} {!../../docs_src/security/tutorial007.py!}
``` ```

16
docs/em/docs/advanced/security/oauth2-scopes.md

@ -63,7 +63,7 @@ Oauth2๏ธโƒฃ ๐Ÿ‘ซ ๐ŸŽป.
๐Ÿฅ‡, โžก๏ธ ๐Ÿ”œ ๐Ÿ‘€ ๐Ÿ• ๐Ÿ‘ˆ ๐Ÿ”€ โšช๏ธโžก๏ธ ๐Ÿ–ผ ๐Ÿ‘‘ **๐Ÿ”ฐ - ๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿฆฎ** [Oauth2๏ธโƒฃ โฎ๏ธ ๐Ÿ” (&amp; ๐Ÿ”), ๐Ÿ“จ โฎ๏ธ ๐Ÿฅ™ ๐Ÿค](../../tutorial/security/oauth2-jwt.md){.internal-link target=_blank}. ๐Ÿ”œ โš™๏ธ Oauth2๏ธโƒฃ โ†”: ๐Ÿฅ‡, โžก๏ธ ๐Ÿ”œ ๐Ÿ‘€ ๐Ÿ• ๐Ÿ‘ˆ ๐Ÿ”€ โšช๏ธโžก๏ธ ๐Ÿ–ผ ๐Ÿ‘‘ **๐Ÿ”ฐ - ๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿฆฎ** [Oauth2๏ธโƒฃ โฎ๏ธ ๐Ÿ” (&amp; ๐Ÿ”), ๐Ÿ“จ โฎ๏ธ ๐Ÿฅ™ ๐Ÿค](../../tutorial/security/oauth2-jwt.md){.internal-link target=_blank}. ๐Ÿ”œ โš™๏ธ Oauth2๏ธโƒฃ โ†”:
```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155" ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
{!../../../docs_src/security/tutorial005.py!} {!../../docs_src/security/tutorial005.py!}
``` ```
๐Ÿ”œ โžก๏ธ ๐Ÿ“„ ๐Ÿ‘ˆ ๐Ÿ”€ ๐Ÿ” ๐Ÿ”. ๐Ÿ”œ โžก๏ธ ๐Ÿ“„ ๐Ÿ‘ˆ ๐Ÿ”€ ๐Ÿ” ๐Ÿ”.
@ -75,7 +75,7 @@ Oauth2๏ธโƒฃ ๐Ÿ‘ซ ๐ŸŽป.
`scopes` ๐Ÿ”ข ๐Ÿ“จ `dict` โฎ๏ธ ๐Ÿ”  โ†” ๐Ÿ”‘ &amp; ๐Ÿ“› ๐Ÿ’ฒ: `scopes` ๐Ÿ”ข ๐Ÿ“จ `dict` โฎ๏ธ ๐Ÿ”  โ†” ๐Ÿ”‘ &amp; ๐Ÿ“› ๐Ÿ’ฒ:
```Python hl_lines="62-65" ```Python hl_lines="62-65"
{!../../../docs_src/security/tutorial005.py!} {!../../docs_src/security/tutorial005.py!}
``` ```
โ†ฉ๏ธ ๐Ÿ‘ฅ ๐Ÿ”œ ๐Ÿ“ฃ ๐Ÿ“š โ†”, ๐Ÿ‘ซ ๐Ÿ”œ ๐ŸŽฆ ๐Ÿ†™ ๐Ÿ› ๏ธ ๐Ÿฉบ ๐Ÿ•โ” ๐Ÿ‘† ๐Ÿ•น-/โœ”. โ†ฉ๏ธ ๐Ÿ‘ฅ ๐Ÿ”œ ๐Ÿ“ฃ ๐Ÿ“š โ†”, ๐Ÿ‘ซ ๐Ÿ”œ ๐ŸŽฆ ๐Ÿ†™ ๐Ÿ› ๏ธ ๐Ÿฉบ ๐Ÿ•โ” ๐Ÿ‘† ๐Ÿ•น-/โœ”.
@ -103,7 +103,7 @@ Oauth2๏ธโƒฃ ๐Ÿ‘ซ ๐ŸŽป.
/// ///
```Python hl_lines="155" ```Python hl_lines="155"
{!../../../docs_src/security/tutorial005.py!} {!../../docs_src/security/tutorial005.py!}
``` ```
## ๐Ÿ“ฃ โ†” *โžก ๐Ÿ› ๏ธ* &amp; ๐Ÿ”— ## ๐Ÿ“ฃ โ†” *โžก ๐Ÿ› ๏ธ* &amp; ๐Ÿ”—
@ -131,7 +131,7 @@ Oauth2๏ธโƒฃ ๐Ÿ‘ซ ๐ŸŽป.
/// ///
```Python hl_lines="4 139 168" ```Python hl_lines="4 139 168"
{!../../../docs_src/security/tutorial005.py!} {!../../docs_src/security/tutorial005.py!}
``` ```
/// info | "๐Ÿ“ก โ„น" /// info | "๐Ÿ“ก โ„น"
@ -159,7 +159,7 @@ Oauth2๏ธโƒฃ ๐Ÿ‘ซ ๐ŸŽป.
๐Ÿ‘‰ `SecurityScopes` ๐ŸŽ“ ๐ŸŽ `Request` (`Request` โš™๏ธ ๐Ÿคš ๐Ÿ“จ ๐ŸŽš ๐Ÿ”—). ๐Ÿ‘‰ `SecurityScopes` ๐ŸŽ“ ๐ŸŽ `Request` (`Request` โš™๏ธ ๐Ÿคš ๐Ÿ“จ ๐ŸŽš ๐Ÿ”—).
```Python hl_lines="8 105" ```Python hl_lines="8 105"
{!../../../docs_src/security/tutorial005.py!} {!../../docs_src/security/tutorial005.py!}
``` ```
## โš™๏ธ `scopes` ## โš™๏ธ `scopes`
@ -175,7 +175,7 @@ Oauth2๏ธโƒฃ ๐Ÿ‘ซ ๐ŸŽป.
๐Ÿ‘‰ โš , ๐Ÿ‘ฅ ๐Ÿ”Œ โ†” ๐Ÿšš (๐Ÿšฅ ๐Ÿ™†) ๐ŸŽป ๐Ÿ‘ฝ ๐Ÿš€ (โš™๏ธ `scope_str`). ๐Ÿ‘ฅ ๐Ÿšฎ ๐Ÿ‘ˆ ๐ŸŽป โš— โ†” `WWW-Authenticate` ๐ŸŽš (๐Ÿ‘‰ ๐Ÿ• ๐Ÿ”Œ). ๐Ÿ‘‰ โš , ๐Ÿ‘ฅ ๐Ÿ”Œ โ†” ๐Ÿšš (๐Ÿšฅ ๐Ÿ™†) ๐ŸŽป ๐Ÿ‘ฝ ๐Ÿš€ (โš™๏ธ `scope_str`). ๐Ÿ‘ฅ ๐Ÿšฎ ๐Ÿ‘ˆ ๐ŸŽป โš— โ†” `WWW-Authenticate` ๐ŸŽš (๐Ÿ‘‰ ๐Ÿ• ๐Ÿ”Œ).
```Python hl_lines="105 107-115" ```Python hl_lines="105 107-115"
{!../../../docs_src/security/tutorial005.py!} {!../../docs_src/security/tutorial005.py!}
``` ```
## โœ” `username` &amp; ๐Ÿ’ฝ ๐Ÿ’  ## โœ” `username` &amp; ๐Ÿ’ฝ ๐Ÿ’ 
@ -193,7 +193,7 @@ Oauth2๏ธโƒฃ ๐Ÿ‘ซ ๐ŸŽป.
๐Ÿ‘ฅ โœ” ๐Ÿ‘ˆ ๐Ÿ‘ฅ โœ”๏ธ ๐Ÿ‘ฉโ€๐Ÿ’ป โฎ๏ธ ๐Ÿ‘ˆ ๐Ÿ†”, &amp; ๐Ÿšฅ ๐Ÿšซ, ๐Ÿ‘ฅ ๐Ÿคš ๐Ÿ‘ˆ ๐ŸŽ โš  ๐Ÿ‘ฅ โœ โญ. ๐Ÿ‘ฅ โœ” ๐Ÿ‘ˆ ๐Ÿ‘ฅ โœ”๏ธ ๐Ÿ‘ฉโ€๐Ÿ’ป โฎ๏ธ ๐Ÿ‘ˆ ๐Ÿ†”, &amp; ๐Ÿšฅ ๐Ÿšซ, ๐Ÿ‘ฅ ๐Ÿคš ๐Ÿ‘ˆ ๐ŸŽ โš  ๐Ÿ‘ฅ โœ โญ.
```Python hl_lines="46 116-127" ```Python hl_lines="46 116-127"
{!../../../docs_src/security/tutorial005.py!} {!../../docs_src/security/tutorial005.py!}
``` ```
## โœ” `scopes` ## โœ” `scopes`
@ -203,7 +203,7 @@ Oauth2๏ธโƒฃ ๐Ÿ‘ซ ๐ŸŽป.
๐Ÿ‘‰, ๐Ÿ‘ฅ โš™๏ธ `security_scopes.scopes`, ๐Ÿ‘ˆ ๐Ÿ”Œ `list` โฎ๏ธ ๐ŸŒ ๐Ÿ‘ซ โ†” `str`. ๐Ÿ‘‰, ๐Ÿ‘ฅ โš™๏ธ `security_scopes.scopes`, ๐Ÿ‘ˆ ๐Ÿ”Œ `list` โฎ๏ธ ๐ŸŒ ๐Ÿ‘ซ โ†” `str`.
```Python hl_lines="128-134" ```Python hl_lines="128-134"
{!../../../docs_src/security/tutorial005.py!} {!../../docs_src/security/tutorial005.py!}
``` ```
## ๐Ÿ”— ๐ŸŒฒ &amp; โ†” ## ๐Ÿ”— ๐ŸŒฒ &amp; โ†”

20
docs/em/docs/advanced/settings.md

@ -149,7 +149,7 @@ Hello World from Python
๐Ÿ‘† ๐Ÿ’ช โš™๏ธ ๐ŸŒ ๐ŸŽ ๐Ÿ”ฌ โš’ &amp; ๐Ÿงฐ ๐Ÿ‘† โš™๏ธ Pydantic ๐Ÿท, ๐Ÿ’– ๐ŸŽ ๐Ÿ“Š ๐Ÿ†Ž &amp; ๐ŸŒ– ๐Ÿ”ฌ โฎ๏ธ `Field()`. ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ ๐ŸŒ ๐ŸŽ ๐Ÿ”ฌ โš’ &amp; ๐Ÿงฐ ๐Ÿ‘† โš™๏ธ Pydantic ๐Ÿท, ๐Ÿ’– ๐ŸŽ ๐Ÿ“Š ๐Ÿ†Ž &amp; ๐ŸŒ– ๐Ÿ”ฌ โฎ๏ธ `Field()`.
```Python hl_lines="2 5-8 11" ```Python hl_lines="2 5-8 11"
{!../../../docs_src/settings/tutorial001.py!} {!../../docs_src/settings/tutorial001.py!}
``` ```
/// tip /// tip
@ -167,7 +167,7 @@ Hello World from Python
โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ ๐Ÿ†• `settings` ๐ŸŽš ๐Ÿ‘† ๐Ÿˆธ: โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ ๐Ÿ†• `settings` ๐ŸŽš ๐Ÿ‘† ๐Ÿˆธ:
```Python hl_lines="18-20" ```Python hl_lines="18-20"
{!../../../docs_src/settings/tutorial001.py!} {!../../docs_src/settings/tutorial001.py!}
``` ```
### ๐Ÿƒ ๐Ÿ’ฝ ### ๐Ÿƒ ๐Ÿ’ฝ
@ -203,13 +203,13 @@ $ ADMIN_EMAIL="[email protected]" APP_NAME="ChimichangApp" uvicorn main:app
๐Ÿ–ผ, ๐Ÿ‘† ๐Ÿ’ช โœ”๏ธ ๐Ÿ“ `config.py` โฎ๏ธ: ๐Ÿ–ผ, ๐Ÿ‘† ๐Ÿ’ช โœ”๏ธ ๐Ÿ“ `config.py` โฎ๏ธ:
```Python ```Python
{!../../../docs_src/settings/app01/config.py!} {!../../docs_src/settings/app01/config.py!}
``` ```
&amp; โคด๏ธ โš™๏ธ โšซ๏ธ ๐Ÿ“ `main.py`: &amp; โคด๏ธ โš™๏ธ โšซ๏ธ ๐Ÿ“ `main.py`:
```Python hl_lines="3 11-13" ```Python hl_lines="3 11-13"
{!../../../docs_src/settings/app01/main.py!} {!../../docs_src/settings/app01/main.py!}
``` ```
/// tip /// tip
@ -229,7 +229,7 @@ $ ADMIN_EMAIL="[email protected]" APP_NAME="ChimichangApp" uvicorn main:app
๐Ÿ‘Ÿ โšช๏ธโžก๏ธ โฎ๏ธ ๐Ÿ–ผ, ๐Ÿ‘† `config.py` ๐Ÿ“ ๐Ÿ’ช ๐Ÿ‘€ ๐Ÿ’–: ๐Ÿ‘Ÿ โšช๏ธโžก๏ธ โฎ๏ธ ๐Ÿ–ผ, ๐Ÿ‘† `config.py` ๐Ÿ“ ๐Ÿ’ช ๐Ÿ‘€ ๐Ÿ’–:
```Python hl_lines="10" ```Python hl_lines="10"
{!../../../docs_src/settings/app02/config.py!} {!../../docs_src/settings/app02/config.py!}
``` ```
๐Ÿ‘€ ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿ‘ฅ ๐Ÿšซ โœ ๐Ÿ”ข ๐Ÿ‘ `settings = Settings()`. ๐Ÿ‘€ ๐Ÿ‘ˆ ๐Ÿ”œ ๐Ÿ‘ฅ ๐Ÿšซ โœ ๐Ÿ”ข ๐Ÿ‘ `settings = Settings()`.
@ -239,7 +239,7 @@ $ ADMIN_EMAIL="[email protected]" APP_NAME="ChimichangApp" uvicorn main:app
๐Ÿ”œ ๐Ÿ‘ฅ โœ ๐Ÿ”— ๐Ÿ‘ˆ ๐Ÿ“จ ๐Ÿ†• `config.Settings()`. ๐Ÿ”œ ๐Ÿ‘ฅ โœ ๐Ÿ”— ๐Ÿ‘ˆ ๐Ÿ“จ ๐Ÿ†• `config.Settings()`.
```Python hl_lines="5 11-12" ```Python hl_lines="5 11-12"
{!../../../docs_src/settings/app02/main.py!} {!../../docs_src/settings/app02/main.py!}
``` ```
/// tip /// tip
@ -253,7 +253,7 @@ $ ADMIN_EMAIL="[email protected]" APP_NAME="ChimichangApp" uvicorn main:app
&amp; โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช ๐Ÿšš โšซ๏ธ โšช๏ธโžก๏ธ *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿ”— &amp; โš™๏ธ โšซ๏ธ ๐Ÿ™† ๐Ÿ‘ฅ ๐Ÿ’ช โšซ๏ธ. &amp; โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช ๐Ÿšš โšซ๏ธ โšช๏ธโžก๏ธ *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* ๐Ÿ”— &amp; โš™๏ธ โšซ๏ธ ๐Ÿ™† ๐Ÿ‘ฅ ๐Ÿ’ช โšซ๏ธ.
```Python hl_lines="16 18-20" ```Python hl_lines="16 18-20"
{!../../../docs_src/settings/app02/main.py!} {!../../docs_src/settings/app02/main.py!}
``` ```
### โš’ &amp; ๐Ÿ”ฌ ### โš’ &amp; ๐Ÿ”ฌ
@ -261,7 +261,7 @@ $ ADMIN_EMAIL="[email protected]" APP_NAME="ChimichangApp" uvicorn main:app
โคด๏ธ โšซ๏ธ ๐Ÿ”œ ๐Ÿ“ถ โฉ ๐Ÿšš ๐ŸŽ โš’ ๐ŸŽš โฎ๏ธ ๐Ÿ”ฌ ๐Ÿ— ๐Ÿ”— ๐Ÿ” `get_settings`: โคด๏ธ โšซ๏ธ ๐Ÿ”œ ๐Ÿ“ถ โฉ ๐Ÿšš ๐ŸŽ โš’ ๐ŸŽš โฎ๏ธ ๐Ÿ”ฌ ๐Ÿ— ๐Ÿ”— ๐Ÿ” `get_settings`:
```Python hl_lines="9-10 13 21" ```Python hl_lines="9-10 13 21"
{!../../../docs_src/settings/app02/test_main.py!} {!../../docs_src/settings/app02/test_main.py!}
``` ```
๐Ÿ”— ๐Ÿ” ๐Ÿ‘ฅ โš’ ๐Ÿ†• ๐Ÿ’ฒ `admin_email` ๐Ÿ•โ” ๐Ÿ— ๐Ÿ†• `Settings` ๐ŸŽš, &amp; โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ“จ ๐Ÿ‘ˆ ๐Ÿ†• ๐ŸŽš. ๐Ÿ”— ๐Ÿ” ๐Ÿ‘ฅ โš’ ๐Ÿ†• ๐Ÿ’ฒ `admin_email` ๐Ÿ•โ” ๐Ÿ— ๐Ÿ†• `Settings` ๐ŸŽš, &amp; โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ“จ ๐Ÿ‘ˆ ๐Ÿ†• ๐ŸŽš.
@ -304,7 +304,7 @@ APP_NAME="ChimichangApp"
&amp; โคด๏ธ โ„น ๐Ÿ‘† `config.py` โฎ๏ธ: &amp; โคด๏ธ โ„น ๐Ÿ‘† `config.py` โฎ๏ธ:
```Python hl_lines="9-10" ```Python hl_lines="9-10"
{!../../../docs_src/settings/app03/config.py!} {!../../docs_src/settings/app03/config.py!}
``` ```
๐Ÿ“ฅ ๐Ÿ‘ฅ โœ ๐ŸŽ“ `Config` ๐Ÿ”˜ ๐Ÿ‘† Pydantic `Settings` ๐ŸŽ“, &amp; โš’ `env_file` ๐Ÿ“ โฎ๏ธ ๐Ÿ‡จ๐Ÿ‡ป ๐Ÿ“ ๐Ÿ‘ฅ ๐Ÿ’š โš™๏ธ. ๐Ÿ“ฅ ๐Ÿ‘ฅ โœ ๐ŸŽ“ `Config` ๐Ÿ”˜ ๐Ÿ‘† Pydantic `Settings` ๐ŸŽ“, &amp; โš’ `env_file` ๐Ÿ“ โฎ๏ธ ๐Ÿ‡จ๐Ÿ‡ป ๐Ÿ“ ๐Ÿ‘ฅ ๐Ÿ’š โš™๏ธ.
@ -339,7 +339,7 @@ def get_settings():
โœ‹๏ธ ๐Ÿ‘ฅ โš™๏ธ `@lru_cache` ๐Ÿ‘จโ€๐ŸŽจ ๐Ÿ”› ๐Ÿ”, `Settings` ๐ŸŽš ๐Ÿ”œ โœ ๐Ÿ•ด ๐Ÿ•, ๐Ÿฅ‡ ๐Ÿ•ฐ โšซ๏ธ ๐Ÿค™. ๐Ÿ‘ถ ๐Ÿ‘ถ โœ‹๏ธ ๐Ÿ‘ฅ โš™๏ธ `@lru_cache` ๐Ÿ‘จโ€๐ŸŽจ ๐Ÿ”› ๐Ÿ”, `Settings` ๐ŸŽš ๐Ÿ”œ โœ ๐Ÿ•ด ๐Ÿ•, ๐Ÿฅ‡ ๐Ÿ•ฐ โšซ๏ธ ๐Ÿค™. ๐Ÿ‘ถ ๐Ÿ‘ถ
```Python hl_lines="1 10" ```Python hl_lines="1 10"
{!../../../docs_src/settings/app03/main.py!} {!../../docs_src/settings/app03/main.py!}
``` ```
โคด๏ธ ๐Ÿ™† ๐Ÿ ๐Ÿค™ `get_settings()` ๐Ÿ”— โญ ๐Ÿ“จ, โ†ฉ๏ธ ๐Ÿ› ๏ธ ๐Ÿ”— ๐Ÿ“Ÿ `get_settings()` &amp; ๐Ÿ— ๐Ÿ†• `Settings` ๐ŸŽš, โšซ๏ธ ๐Ÿ”œ ๐Ÿ“จ ๐ŸŽ ๐ŸŽš ๐Ÿ‘ˆ ๐Ÿ“จ ๐Ÿ”› ๐Ÿฅ‡ ๐Ÿค™, ๐Ÿ”„ &amp; ๐Ÿ”„. โคด๏ธ ๐Ÿ™† ๐Ÿ ๐Ÿค™ `get_settings()` ๐Ÿ”— โญ ๐Ÿ“จ, โ†ฉ๏ธ ๐Ÿ› ๏ธ ๐Ÿ”— ๐Ÿ“Ÿ `get_settings()` &amp; ๐Ÿ— ๐Ÿ†• `Settings` ๐ŸŽš, โšซ๏ธ ๐Ÿ”œ ๐Ÿ“จ ๐ŸŽ ๐ŸŽš ๐Ÿ‘ˆ ๐Ÿ“จ ๐Ÿ”› ๐Ÿฅ‡ ๐Ÿค™, ๐Ÿ”„ &amp; ๐Ÿ”„.

6
docs/em/docs/advanced/sub-applications.md

@ -11,7 +11,7 @@
๐Ÿฅ‡, โœ ๐Ÿ‘‘, ๐Ÿ”-๐ŸŽš, **FastAPI** ๐Ÿˆธ, &amp; ๐Ÿšฎ *โžก ๐Ÿ› ๏ธ*: ๐Ÿฅ‡, โœ ๐Ÿ‘‘, ๐Ÿ”-๐ŸŽš, **FastAPI** ๐Ÿˆธ, &amp; ๐Ÿšฎ *โžก ๐Ÿ› ๏ธ*:
```Python hl_lines="3 6-8" ```Python hl_lines="3 6-8"
{!../../../docs_src/sub_applications/tutorial001.py!} {!../../docs_src/sub_applications/tutorial001.py!}
``` ```
### ๐ŸŽง-๐Ÿˆธ ### ๐ŸŽง-๐Ÿˆธ
@ -21,7 +21,7 @@
๐Ÿ‘‰ ๐ŸŽง-๐Ÿˆธ โž•1๏ธโƒฃ ๐Ÿฉ FastAPI ๐Ÿˆธ, โœ‹๏ธ ๐Ÿ‘‰ 1๏ธโƒฃ ๐Ÿ‘ˆ ๐Ÿ”œ "๐Ÿ—ป": ๐Ÿ‘‰ ๐ŸŽง-๐Ÿˆธ โž•1๏ธโƒฃ ๐Ÿฉ FastAPI ๐Ÿˆธ, โœ‹๏ธ ๐Ÿ‘‰ 1๏ธโƒฃ ๐Ÿ‘ˆ ๐Ÿ”œ "๐Ÿ—ป":
```Python hl_lines="11 14-16" ```Python hl_lines="11 14-16"
{!../../../docs_src/sub_applications/tutorial001.py!} {!../../docs_src/sub_applications/tutorial001.py!}
``` ```
### ๐Ÿ—ป ๐ŸŽง-๐Ÿˆธ ### ๐Ÿ—ป ๐ŸŽง-๐Ÿˆธ
@ -31,7 +31,7 @@
๐Ÿ‘‰ ๐Ÿ’ผ, โšซ๏ธ ๐Ÿ”œ ๐Ÿ“Œ โžก `/subapi`: ๐Ÿ‘‰ ๐Ÿ’ผ, โšซ๏ธ ๐Ÿ”œ ๐Ÿ“Œ โžก `/subapi`:
```Python hl_lines="11 19" ```Python hl_lines="11 19"
{!../../../docs_src/sub_applications/tutorial001.py!} {!../../docs_src/sub_applications/tutorial001.py!}
``` ```
### โœ… ๐Ÿง ๐Ÿ› ๏ธ ๐Ÿฉบ ### โœ… ๐Ÿง ๐Ÿ› ๏ธ ๐Ÿฉบ

8
docs/em/docs/advanced/templates.md

@ -28,7 +28,7 @@ $ pip install jinja2
* โš™๏ธ `templates` ๐Ÿ‘† โœ โœ &amp; ๐Ÿ“จ `TemplateResponse`, ๐Ÿšถโ€โ™€๏ธ `request` 1๏ธโƒฃ ๐Ÿ”‘-๐Ÿ’ฒ ๐Ÿ‘ซ Jinja2๏ธโƒฃ "๐Ÿ”‘". * โš™๏ธ `templates` ๐Ÿ‘† โœ โœ &amp; ๐Ÿ“จ `TemplateResponse`, ๐Ÿšถโ€โ™€๏ธ `request` 1๏ธโƒฃ ๐Ÿ”‘-๐Ÿ’ฒ ๐Ÿ‘ซ Jinja2๏ธโƒฃ "๐Ÿ”‘".
```Python hl_lines="4 11 15-18" ```Python hl_lines="4 11 15-18"
{!../../../docs_src/templates/tutorial001.py!} {!../../docs_src/templates/tutorial001.py!}
``` ```
/// note /// note
@ -56,7 +56,7 @@ $ pip install jinja2
โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โœ ๐Ÿ“„ `templates/item.html` โฎ๏ธ: โคด๏ธ ๐Ÿ‘† ๐Ÿ’ช โœ ๐Ÿ“„ `templates/item.html` โฎ๏ธ:
```jinja hl_lines="7" ```jinja hl_lines="7"
{!../../../docs_src/templates/templates/item.html!} {!../../docs_src/templates/templates/item.html!}
``` ```
โšซ๏ธ ๐Ÿ”œ ๐ŸŽฆ `id` โœŠ โšช๏ธโžก๏ธ "๐Ÿ”‘" `dict` ๐Ÿ‘† ๐Ÿšถโ€โ™€๏ธ: โšซ๏ธ ๐Ÿ”œ ๐ŸŽฆ `id` โœŠ โšช๏ธโžก๏ธ "๐Ÿ”‘" `dict` ๐Ÿ‘† ๐Ÿšถโ€โ™€๏ธ:
@ -70,13 +70,13 @@ $ pip install jinja2
&amp; ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `url_for()` ๐Ÿ”˜ ๐Ÿ“„, &amp; โš™๏ธ โšซ๏ธ, ๐Ÿ–ผ, โฎ๏ธ `StaticFiles` ๐Ÿ‘† ๐Ÿ“Œ. &amp; ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `url_for()` ๐Ÿ”˜ ๐Ÿ“„, &amp; โš™๏ธ โšซ๏ธ, ๐Ÿ–ผ, โฎ๏ธ `StaticFiles` ๐Ÿ‘† ๐Ÿ“Œ.
```jinja hl_lines="4" ```jinja hl_lines="4"
{!../../../docs_src/templates/templates/item.html!} {!../../docs_src/templates/templates/item.html!}
``` ```
๐Ÿ‘‰ ๐Ÿ–ผ, โšซ๏ธ ๐Ÿ”œ ๐Ÿ”— ๐ŸŽš ๐Ÿ“ `static/styles.css` โฎ๏ธ: ๐Ÿ‘‰ ๐Ÿ–ผ, โšซ๏ธ ๐Ÿ”œ ๐Ÿ”— ๐ŸŽš ๐Ÿ“ `static/styles.css` โฎ๏ธ:
```CSS hl_lines="4" ```CSS hl_lines="4"
{!../../../docs_src/templates/static/styles.css!} {!../../docs_src/templates/static/styles.css!}
``` ```
&amp; โ†ฉ๏ธ ๐Ÿ‘† โš™๏ธ `StaticFiles`, ๐Ÿ‘ˆ ๐ŸŽš ๐Ÿ“ ๐Ÿ”œ ๐Ÿฆ ๐Ÿ” ๐Ÿ‘† **FastAPI** ๐Ÿˆธ ๐Ÿ“› `/static/styles.css`. &amp; โ†ฉ๏ธ ๐Ÿ‘† โš™๏ธ `StaticFiles`, ๐Ÿ‘ˆ ๐ŸŽš ๐Ÿ“ ๐Ÿ”œ ๐Ÿฆ ๐Ÿ” ๐Ÿ‘† **FastAPI** ๐Ÿˆธ ๐Ÿ“› `/static/styles.css`.

8
docs/em/docs/advanced/testing-database.md

@ -49,7 +49,7 @@
โœ‹๏ธ ๐ŸŽ‚ ๐ŸŽ‰ ๐Ÿ“Ÿ ๐ŸŒ… โš–๏ธ ๐ŸŒ˜ ๐ŸŽ, ๐Ÿ‘ฅ ๐Ÿ“ โšซ๏ธ. โœ‹๏ธ ๐ŸŽ‚ ๐ŸŽ‰ ๐Ÿ“Ÿ ๐ŸŒ… โš–๏ธ ๐ŸŒ˜ ๐ŸŽ, ๐Ÿ‘ฅ ๐Ÿ“ โšซ๏ธ.
```Python hl_lines="8-13" ```Python hl_lines="8-13"
{!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!} {!../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
``` ```
/// tip /// tip
@ -73,7 +73,7 @@ Base.metadata.create_all(bind=engine)
๐Ÿ‘ฅ ๐Ÿšฎ ๐Ÿ‘ˆ โธ ๐Ÿ“ฅ, โฎ๏ธ ๐Ÿ†• ๐Ÿ“. ๐Ÿ‘ฅ ๐Ÿšฎ ๐Ÿ‘ˆ โธ ๐Ÿ“ฅ, โฎ๏ธ ๐Ÿ†• ๐Ÿ“.
```Python hl_lines="16" ```Python hl_lines="16"
{!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!} {!../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
``` ```
## ๐Ÿ”— ๐Ÿ” ## ๐Ÿ”— ๐Ÿ”
@ -81,7 +81,7 @@ Base.metadata.create_all(bind=engine)
๐Ÿ”œ ๐Ÿ‘ฅ โœ ๐Ÿ”— ๐Ÿ” &amp; ๐Ÿšฎ โšซ๏ธ ๐Ÿ” ๐Ÿ‘† ๐Ÿ“ฑ. ๐Ÿ”œ ๐Ÿ‘ฅ โœ ๐Ÿ”— ๐Ÿ” &amp; ๐Ÿšฎ โšซ๏ธ ๐Ÿ” ๐Ÿ‘† ๐Ÿ“ฑ.
```Python hl_lines="19-24 27" ```Python hl_lines="19-24 27"
{!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!} {!../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
``` ```
/// tip /// tip
@ -95,7 +95,7 @@ Base.metadata.create_all(bind=engine)
โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช ๐Ÿ’ฏ ๐Ÿ“ฑ ๐Ÿ›Ž. โคด๏ธ ๐Ÿ‘ฅ ๐Ÿ’ช ๐Ÿ’ฏ ๐Ÿ“ฑ ๐Ÿ›Ž.
```Python hl_lines="32-47" ```Python hl_lines="32-47"
{!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!} {!../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
``` ```
&amp; ๐ŸŒ ๐Ÿ› ๏ธ ๐Ÿ‘ฅ โš’ ๐Ÿ’ฝ โฎ๏ธ ๐Ÿ’ฏ ๐Ÿ”œ `test.db` ๐Ÿ’ฝ โ†ฉ๏ธ ๐Ÿ‘‘ `sql_app.db`. &amp; ๐ŸŒ ๐Ÿ› ๏ธ ๐Ÿ‘ฅ โš’ ๐Ÿ’ฝ โฎ๏ธ ๐Ÿ’ฏ ๐Ÿ”œ `test.db` ๐Ÿ’ฝ โ†ฉ๏ธ ๐Ÿ‘‘ `sql_app.db`.

2
docs/em/docs/advanced/testing-dependencies.md

@ -29,7 +29,7 @@
&amp; โคด๏ธ **FastAPI** ๐Ÿ”œ ๐Ÿค™ ๐Ÿ‘ˆ ๐Ÿ” โ†ฉ๏ธ โฎ๏ธ ๐Ÿ”—. &amp; โคด๏ธ **FastAPI** ๐Ÿ”œ ๐Ÿค™ ๐Ÿ‘ˆ ๐Ÿ” โ†ฉ๏ธ โฎ๏ธ ๐Ÿ”—.
```Python hl_lines="28-29 32" ```Python hl_lines="28-29 32"
{!../../../docs_src/dependency_testing/tutorial001.py!} {!../../docs_src/dependency_testing/tutorial001.py!}
``` ```
/// tip /// tip

2
docs/em/docs/advanced/testing-events.md

@ -3,5 +3,5 @@
๐Ÿ•โ” ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ‘† ๐ŸŽ‰ ๐Ÿ•โ€๐Ÿฆบ (`startup` &amp; `shutdown`) ๐Ÿƒ ๐Ÿ‘† ๐Ÿ’ฏ, ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `TestClient` โฎ๏ธ `with` ๐Ÿ“„: ๐Ÿ•โ” ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ‘† ๐ŸŽ‰ ๐Ÿ•โ€๐Ÿฆบ (`startup` &amp; `shutdown`) ๐Ÿƒ ๐Ÿ‘† ๐Ÿ’ฏ, ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ `TestClient` โฎ๏ธ `with` ๐Ÿ“„:
```Python hl_lines="9-12 20-24" ```Python hl_lines="9-12 20-24"
{!../../../docs_src/app_testing/tutorial003.py!} {!../../docs_src/app_testing/tutorial003.py!}
``` ```

Some files were not shown because too many files changed in this diff

Loadingโ€ฆ
Cancel
Save