- Sort Score
- Result 10 results
- Languages All
Results 431 - 440 of 895 for python (0.25 sec)
-
docs/zh/docs/advanced/events.md
/// ## `startup` 事件 使用 `startup` 事件声明 `app` 启动前运行的函数: ```Python hl_lines="8" {!../../docs_src/events/tutorial001.py!} ``` 本例中,`startup` 事件处理器函数为项目数据库(只是**字典**)提供了一些初始值。 **FastAPI** 支持多个事件处理器函数。 只有所有 `startup` 事件处理器运行完毕,**FastAPI** 应用才开始接收请求。 ## `shutdown` 事件 使用 `shutdown` 事件声明 `app` 关闭时运行的函数: ```Python hl_lines="6" {!../../docs_src/events/tutorial002.py!} ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 1.7K bytes - Viewed (0) -
docs/zh/docs/tutorial/handling-errors.md
大家都知道**「404 Not Found」**错误,还有调侃这个错误的笑话吧? ## 使用 `HTTPException` 向客户端返回 HTTP 错误响应,可以使用 `HTTPException`。 ### 导入 `HTTPException` ```Python hl_lines="1" {!../../docs_src/handling_errors/tutorial001.py!} ``` ### 触发 `HTTPException` `HTTPException` 是额外包含了和 API 有关数据的常规 Python 异常。 因为是 Python 异常,所以不能 `return`,只能 `raise`。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 8.4K bytes - Viewed (0) -
.github/workflows/deploy-docs.yml
- name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} run: echo "$GITHUB_CONTEXT" - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.11" - name: Setup uv uses: astral-sh/setup-uv@v3 with: version: "0.4.15" enable-cache: true cache-dependency-glob: |
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Oct 26 09:37:59 UTC 2024 - 2.6K bytes - Viewed (0) -
docs/es/docs/advanced/path-operation-advanced-configuration.md
Incluso si están en diferentes módulos (archivos Python). /// ## Excluir de OpenAPI Para excluir una *operación de path* del esquema OpenAPI generado (y por tanto del la documentación generada automáticamente), usa el parámetro `include_in_schema` y asigna el valor como `False`; ```Python hl_lines="6" {!../../docs_src/path_operation_advanced_configuration/tutorial003.py!} ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2.1K bytes - Viewed (0) -
README.md
You do that with standard modern Python types. You don't have to learn a new syntax, the methods or classes of a specific library, etc. Just standard **Python**. For example, for an `int`: ```Python item_id: int ``` or for a more complex `Item` model: ```Python item: Item ``` ...and with that single declaration you get:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Oct 31 09:13:26 UTC 2024 - 23.6K bytes - Viewed (0) -
docs/de/docs/advanced/async-tests.md
``` . ├── app │ ├── __init__.py │ ├── main.py │ └── test_main.py ``` Die Datei `main.py` hätte als Inhalt: ```Python {!../../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: ```Python {!../../docs_src/async_tests/test_main.py!} ``` ## Es ausführen Sie können Ihre Tests wie gewohnt ausführen mit:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 15:34:47 UTC 2024 - 4.3K bytes - Viewed (0) -
docs/fr/docs/index.md
Vous faites cela avec les types Python standard modernes. Vous n'avez pas à apprendre une nouvelle syntaxe, les méthodes ou les classes d'une bibliothèque spécifique, etc. Juste du **Python** standard. Par exemple, pour un `int`: ```Python item_id: int ``` ou pour un modèle `Item` plus complexe : ```Python item: Item ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 20 19:20:23 UTC 2024 - 22K bytes - Viewed (0) -
docs/vi/docs/features.md
### Chỉ cần phiên bản Python hiện đại Tất cả được dựa trên khai báo kiểu dữ liệu chuẩn của **Python 3.8** (cảm ơn Pydantic). Bạn không cần học cú pháp mới, chỉ cần biết chuẩn Python hiện đại. Nếu bạn cần 2 phút để làm mới lại cách sử dụng các kiểu dữ liệu mới của Python (thậm chí nếu bạn không sử dụng FastAPI), xem hướng dẫn ngắn: [Kiểu dữ liệu Python](python-types.md){.internal-link target=_blank}.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Aug 06 04:48:30 UTC 2024 - 11.5K bytes - Viewed (0) -
docs/zh/docs/features.md
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png) ### 更主流的 Python 全部都基于标准的 **Python 3.6 类型**声明(感谢 Pydantic )。没有新的语法需要学习。只需要标准的 Python 。 如果你需要2分钟来学习如何使用 Python 类型(即使你不使用 FastAPI ),看看这个简短的教程:[Python Types](python-types.md){.internal-link target=_blank}。 编写带有类型标注的标准 Python: ```Python from datetime import date from pydantic import BaseModel # Declare a variable as a str
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Aug 06 04:48:30 UTC 2024 - 8.9K bytes - Viewed (0) -
docs/de/docs/advanced/generate-clients.md
## Einen TypeScript-Frontend-Client generieren Beginnen wir mit einer einfachen FastAPI-Anwendung: //// tab | Python 3.9+ ```Python hl_lines="7-9 12-13 16-17 21" {!> ../../docs_src/generate_clients/tutorial001_py39.py!} ``` //// //// tab | Python 3.8+ ```Python hl_lines="9-11 14-15 18 19 23" {!> ../../docs_src/generate_clients/tutorial001.py!} ``` ////
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 11.9K bytes - Viewed (0)