- Sort Score
- Result 10 results
- Languages All
Results 531 - 540 of 890 for docs_src (0.13 sec)
-
docs/zh/docs/advanced/testing-events.md
# 测试事件:启动 - 关闭 使用 `TestClient` 和 `with` 语句,在测试中运行事件处理器(`startup` 与 `shutdown`)。 ```Python hl_lines="9-12 20-24" {!../../docs_src/app_testing/tutorial003.py!}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 225 bytes - Viewed (0) -
docs/es/docs/advanced/response-headers.md
Y entonces, podrás configurar las cookies en ese objeto de response *temporal*. ```Python hl_lines="1 7-8" {!../../docs_src/response_headers/tutorial002.py!} ``` Posteriormente, puedes devolver cualquier objeto que necesites, como normalmente harías (un `dict`, un modelo de base de datos, etc).
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2.5K bytes - Viewed (0) -
docs/en/docs/advanced/testing-events.md
# Testing Events: startup - shutdown When you need your event handlers (`startup` and `shutdown`) to run in your tests, you can use the `TestClient` with a `with` statement: ```Python hl_lines="9-12 20-24" {!../../docs_src/app_testing/tutorial003.py!}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 259 bytes - Viewed (0) -
tests/test_tutorial/test_extra_models/test_tutorial004_py39.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_py39 @pytest.fixture(name="client") def get_client(): from docs_src.extra_models.tutorial004_py39 import app client = TestClient(app) return client @needs_py39 def test_get_items(client: TestClient): response = client.get("/items/") assert response.status_code == 200, response.text assert response.json() == [
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.1K bytes - Viewed (0) -
docs/ja/docs/tutorial/request-forms.md
たとえば、`pip install python-multipart`のように。 /// ## `Form`のインポート `fastapi`から`Form`をインポートします: ```Python hl_lines="1" {!../../docs_src/request_forms/tutorial001.py!} ``` ## `Form`のパラメータの定義 `Body`や`Query`の場合と同じようにフォームパラメータを作成します: ```Python hl_lines="7" {!../../docs_src/request_forms/tutorial001.py!} ``` 例えば、OAuth2仕様が使用できる方法の1つ(「パスワードフロー」と呼ばれる)では、フォームフィールドとして`username`と`password`を送信する必要があります。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.3K bytes - Viewed (0) -
docs/en/docs/advanced/security/http-basic-auth.md
* Use that `security` with a dependency in your *path operation*. * It returns an object of type `HTTPBasicCredentials`: * It contains the `username` and `password` sent. {* ../../docs_src/security/tutorial006_an_py39.py hl[4,8,12] *} When you try to open the URL for the first time (or click the "Execute" button in the docs) the browser will ask you for your username and password:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Oct 26 16:01:27 UTC 2024 - 4.8K bytes - Viewed (0) -
docs/pt/docs/tutorial/security/first-steps.md
## Como Parece Vamos primeiro usar o código e ver como funciona, e depois voltaremos para entender o que está acontecendo. ## Crie um `main.py` Copie o exemplo em um arquivo `main.py`: ```Python {!../../docs_src/security/tutorial001.py!} ``` ## Execute-o /// info | "informação" ///
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 8.4K bytes - Viewed (0) -
docs/tr/docs/advanced/wsgi.md
`WSGIMiddleware`'ı projenize dahil edin. Ardından WSGI (örneğin Flask) uygulamanızı middleware ile sarmalayın. Son olarak da bir yol altında bağlama işlemini gerçekleştirin. ```Python hl_lines="2-3 23" {!../../docs_src/wsgi/tutorial001.py!} ``` ## Kontrol Edelim Artık `/v1/` yolunun altındaki her istek Flask uygulaması tarafından işlenecektir. Geri kalanı ise **FastAPI** tarafından işlenecektir.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 1.3K bytes - Viewed (0) -
tests/test_tutorial/test_configure_swagger_ui/test_tutorial002.py
from fastapi.testclient import TestClient from docs_src.configure_swagger_ui.tutorial002 import app client = TestClient(app) def test_swagger_ui(): response = client.get("/docs") assert response.status_code == 200, response.text assert ( '"syntaxHighlight": false' not in response.text ), "not used parameters should not be included" assert ( '"syntaxHighlight.theme": "obsidian"' in response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Aug 19 19:54:04 UTC 2023 - 1.5K bytes - Viewed (0) -
tests/test_tutorial/test_security/test_tutorial001_an_py39.py
import pytest from fastapi.testclient import TestClient from ...utils import needs_py39 @pytest.fixture(name="client") def get_client(): from docs_src.security.tutorial001_an_py39 import app client = TestClient(app) return client @needs_py39 def test_no_token(client: TestClient): response = client.get("/items") assert response.status_code == 401, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.1K bytes - Viewed (0)