- Sort Score
- Result 10 results
- Languages All
Results 241 - 250 of 877 for tutorial002 (0.06 sec)
-
docs/zh/docs/advanced/middleware.md
强制所有传入请求必须是 `https` 或 `wss`。 任何传向 `http` 或 `ws` 的请求都会被重定向至安全方案。 ```Python hl_lines="2 6" {!../../docs_src/advanced_middleware/tutorial001.py!} ``` ## `TrustedHostMiddleware` 强制所有传入请求都必须正确设置 `Host` 请求头,以防 HTTP 主机头攻击。 ```Python hl_lines="2 6-8" {!../../docs_src/advanced_middleware/tutorial002.py!} ``` 支持以下参数: * `allowed_hosts` - 允许的域名(主机名)列表。`*.example.com` 等通配符域名可以匹配子域名,或使用 `allowed_hosts=["*"]` 允许任意主机名,或省略中间件。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.5K bytes - Viewed (0) -
docs/ru/docs/tutorial/response-model.md
```Python hl_lines="7 9" {!> ../../docs_src/response_model/tutorial002_py310.py!} ``` //// //// tab | Python 3.8+ ```Python hl_lines="9 11" {!> ../../docs_src/response_model/tutorial002.py!} ``` //// /// info | "Информация"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 30.4K bytes - Viewed (0) -
docs/ru/docs/tutorial/path-params.md
```Python hl_lines="17" {!../../docs_src/path_params/tutorial005.py!} ``` #### Получение *значения перечисления* Можно получить фактическое значение (в данном случае - `str`) с помощью `model_name.value` или в общем случае `your_enum_member.value`: ```Python hl_lines="20" {!../../docs_src/path_params/tutorial005.py!} ``` /// tip | "Подсказка"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 14.1K bytes - Viewed (0) -
docs/pt/docs/tutorial/response-status-code.md
```Python hl_lines="6" {!../../docs_src/response_status_code/tutorial001.py!} ``` `201` é o código de status para "Criado". Mas você não precisa memorizar o que cada um desses códigos significa. Você pode usar as variáveis de conveniência de `fastapi.status`. ```Python hl_lines="1 6" {!../../docs_src/response_status_code/tutorial002.py!} ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 4.3K bytes - Viewed (0) -
docs/en/docs/advanced/response-directly.md
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3K bytes - Viewed (0) -
tests/test_tutorial/test_request_form_models/test_tutorial002.py
import pytest from fastapi.testclient import TestClient from tests.utils import needs_pydanticv2 @pytest.fixture(name="client") def get_client(): from docs_src.request_form_models.tutorial002 import app client = TestClient(app) return client @needs_pydanticv2 def test_post_body_form(client: TestClient): response = client.post("/login/", data={"username": "Foo", "password": "secret"})
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Sep 06 17:31:18 UTC 2024 - 6.2K bytes - Viewed (0) -
docs/fr/docs/tutorial/body.md
Commencez par importer la classe `BaseModel` du module `pydantic` : {* ../../docs_src/body/tutorial001.py hl[4] *} ## Créez votre modèle de données Déclarez ensuite votre modèle de données en tant que classe qui hérite de `BaseModel`. Utilisez les types Python standard pour tous les attributs : {* ../../docs_src/body/tutorial001.py hl[7:11] *}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 17:34:41 UTC 2024 - 7.6K bytes - Viewed (0) -
docs/ru/docs/tutorial/body.md
```Python hl_lines="4" {!../../docs_src/body/tutorial001.py!} ``` ## Создание вашей собственной модели После этого вы описываете вашу модель данных как класс, наследующий от `BaseModel`. Используйте аннотации типов Python для всех атрибутов: ```Python hl_lines="7-11" {!../../docs_src/body/tutorial001.py!} ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 10.9K bytes - Viewed (0) -
docs/fr/docs/advanced/response-directly.md
Vous pouvez mettre votre contenu XML dans une chaîne de caractères, la placer dans une `Response`, et la retourner : ```Python hl_lines="1 18" {!../../docs_src/response_directly/tutorial002.py!} ``` ## Notes Lorsque vous renvoyez une `Response` directement, ses données ne sont pas validées, converties (sérialisées), ni documentées automatiquement.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.6K bytes - Viewed (0) -
docs/de/docs/tutorial/metadata.md
Sie können das aber mit dem Parameter `openapi_url` konfigurieren. Um beispielsweise festzulegen, dass es unter `/api/v1/openapi.json` bereitgestellt wird: ```Python hl_lines="3" {!../../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.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 6.6K bytes - Viewed (0)