- Sort Score
- Result 10 results
- Languages All
Results 481 - 490 of 616 for tutorial012_py39 (0.46 sec)
-
tests/test_tutorial/test_handling_errors/test_tutorial001.py
from fastapi.testclient import TestClient from docs_src.handling_errors.tutorial001_py39 import app client = TestClient(app) def test_get_item(): response = client.get("/items/foo") assert response.status_code == 200, response.text assert response.json() == {"item": "The Foo Wrestlers"} def test_get_item_not_found(): response = client.get("/items/bar") assert response.status_code == 404, response.text
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 3.2K bytes - Viewed (0) -
docs/ru/docs/advanced/response-change-status-code.md
И затем вы можете установить `status_code` в этом *временном* объекте ответа. {* ../../docs_src/response_change_status_code/tutorial001_py39.py hl[1,9,12] *} После этого вы можете вернуть любой объект, который вам нужен, как обычно (`dict`, модель базы данных и т.д.).Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.7K bytes - Viewed (0) -
docs/pt/docs/advanced/response-directly.md
Você pode colocar o seu conteúdo XML em uma string, colocar em uma `Response`, e retorná-lo: {* ../../docs_src/response_directly/tutorial002_py39.py hl[1,18] *} ## Notas { #notes } Quando você retorna uma `Response` diretamente os dados não são validados, convertidos (serializados) ou documentados automaticamente.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 3.5K bytes - Viewed (0) -
tests/test_tutorial/test_handling_errors/test_tutorial004.py
from fastapi.testclient import TestClient from docs_src.handling_errors.tutorial004_py39 import app client = TestClient(app) def test_get_validation_error(): response = client.get("/items/foo") assert response.status_code == 400, response.text assert "Validation errors:" in response.text assert "Field: ('path', 'item_id')" in response.text def test_get_http_error(): response = client.get("/items/3")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 3.4K bytes - Viewed (0) -
docs/de/docs/tutorial/static-files.md
## `StaticFiles` verwenden { #use-staticfiles } * Importieren Sie `StaticFiles`. * „Mounten“ Sie eine `StaticFiles()`-Instanz in einem bestimmten Pfad. {* ../../docs_src/static_files/tutorial001_py39.py hl[2,6] *} /// note | Technische Details Sie könnten auch `from starlette.staticfiles import StaticFiles` verwenden.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2K bytes - Viewed (0) -
tests/test_tutorial/test_schema_extra_example/test_tutorial001.py
import importlib import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 @pytest.fixture( name="client", params=[ pytest.param("tutorial001_py39"), pytest.param("tutorial001_py310", marks=needs_py310), ], ) def get_client(request: pytest.FixtureRequest): mod = importlib.import_module(f"docs_src.schema_extra_example.{request.param}")
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 20 15:55:38 UTC 2025 - 4.8K bytes - Viewed (0) -
docs/ru/docs/tutorial/debugging.md
## Вызов `uvicorn` { #call-uvicorn } В вашем FastAPI приложении, импортируйте и вызовите `uvicorn` напрямую: {* ../../docs_src/debugging/tutorial001_py39.py hl[1,15] *} ### Описание `__name__ == "__main__"` { #about-name-main } Главная цель использования `__name__ == "__main__"` в том, чтобы код выполнялся при запуске файла с помощью: <div class="termy">Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 3.9K bytes - Viewed (0) -
docs/es/docs/advanced/using-request-directly.md
Imaginemos que quieres obtener la dirección IP/host del cliente dentro de tu *path operation function*. Para eso necesitas acceder al request directamente. {* ../../docs_src/using_request_directly/tutorial001_py39.py hl[1,7:8] *} Al declarar un parámetro de *path operation function* con el tipo siendo `Request`, **FastAPI** sabrá pasar el `Request` en ese parámetro. /// tip | ConsejoRegistered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.5K bytes - Viewed (0) -
docs/es/docs/how-to/conditional-openapi.md
Puedes usar fácilmente las mismas configuraciones de Pydantic para configurar tu OpenAPI generado y las interfaces de usuario de la documentación. Por ejemplo: {* ../../docs_src/conditional_openapi/tutorial001_py39.py hl[6,11] *} Aquí declaramos la configuración `openapi_url` con el mismo valor por defecto de `"/openapi.json"`. Y luego la usamos al crear la app de `FastAPI`.Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Wed Dec 17 20:41:43 UTC 2025 - 2.6K bytes - Viewed (0) -
tests/test_tutorial/test_body_multiple_params/test_tutorial001.py
import importlib import pytest from fastapi.testclient import TestClient from ...utils import needs_py310 @pytest.fixture( name="client", params=[ "tutorial001_py39", pytest.param("tutorial001_py310", marks=needs_py310), "tutorial001_an_py39", pytest.param("tutorial001_an_py310", marks=needs_py310), ], ) def get_client(request: pytest.FixtureRequest):
Registered: Sun Dec 28 07:19:09 UTC 2025 - Last Modified: Sat Dec 27 18:19:10 UTC 2025 - 6.3K bytes - Viewed (0)