Search Options

Results per page
Sort
Preferred Languages
Advance

Results 431 - 440 of 550 for tutorial009b_py39 (0.12 sec)

  1. tests/test_tutorial/test_request_files/test_tutorial003.py

    import importlib
    
    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(
        name="app",
        params=[
            "tutorial003_py39",
            "tutorial003_an_py39",
        ],
    )
    def get_app(request: pytest.FixtureRequest):
        mod = importlib.import_module(f"docs_src.request_files.{request.param}")
    
        return mod.app
    
    
    @pytest.fixture(name="client")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 7.5K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/static-files.md

    ## Use `StaticFiles` { #use-staticfiles }
    
    * Import `StaticFiles`.
    * "Mount" a `StaticFiles()` instance in a specific path.
    
    {* ../../docs_src/static_files/tutorial001_py39.py hl[2,6] *}
    
    /// note | Technical Details
    
    You could also use `from starlette.staticfiles import StaticFiles`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  3. docs/es/docs/tutorial/static-files.md

    ## Usa `StaticFiles` { #use-staticfiles }
    
    * Importa `StaticFiles`.
    * "Monta" una instance de `StaticFiles()` en un path específico.
    
    {* ../../docs_src/static_files/tutorial001_py39.py hl[2,6] *}
    
    /// note | Detalles Técnicos
    
    También podrías usar `from starlette.staticfiles import StaticFiles`.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.9K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/response-change-status-code.md

    And then you can set the `status_code` in that *temporal* response object.
    
    {* ../../docs_src/response_change_status_code/tutorial001_py39.py hl[1,9,12] *}
    
    And then you can return any object you need, as you normally would (a `dict`, a database model, etc).
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 1.5K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_path_operation_configurations/test_tutorial001.py

    import pytest
    from dirty_equals import IsList
    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) -> TestClient:
        mod = importlib.import_module(
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 6.2K bytes
    - Viewed (0)
  6. docs/ru/docs/advanced/using-request-directly.md

    Представим, что вы хотите получить IP-адрес/хост клиента внутри вашей *функции-обработчика пути*.
    
    Для этого нужно обратиться к запросу напрямую.
    
    {* ../../docs_src/using_request_directly/tutorial001_py39.py hl[1,7:8] *}
    
    Если объявить параметр *функции-обработчика пути* с типом `Request`, **FastAPI** поймёт, что нужно передать объект `Request` в этот параметр.
    
    /// tip | Совет
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_additional_responses/test_tutorial003.py

    from fastapi.testclient import TestClient
    
    from docs_src.additional_responses.tutorial003_py39 import app
    
    client = TestClient(app)
    
    
    def test_path_operation():
        response = client.get("/items/foo")
        assert response.status_code == 200, response.text
        assert response.json() == {"id": "foo", "value": "there goes my hero"}
    
    
    def test_path_operation_not_found():
        response = client.get("/items/bar")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 4.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_response_directly/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.response_directly.{request.param}")
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 20 15:55:38 UTC 2025
    - 5.1K bytes
    - Viewed (0)
  9. docs/ru/docs/tutorial/handling-errors.md

    Для возврата клиенту HTTP-ответов с ошибками используется `HTTPException`.
    
    ### Импортируйте `HTTPException` { #import-httpexception }
    
    {* ../../docs_src/handling_errors/tutorial001_py39.py hl[1] *}
    
    ### Вызовите `HTTPException` в своем коде { #raise-an-httpexception-in-your-code }
    
    `HTTPException` - это обычное исключение Python с дополнительными данными, актуальными для API.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 14.1K bytes
    - Viewed (0)
  10. docs/ru/docs/advanced/response-directly.md

    Вы можете поместить ваш XML-контент в строку, поместить её в `Response` и вернуть:
    
    {* ../../docs_src/response_directly/tutorial002_py39.py hl[1,18] *}
    
    ## Примечания { #notes }
    
    Когда вы возвращаете объект `Response` напрямую, его данные не валидируются, не преобразуются (не сериализуются) и не документируются автоматически.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 5.1K bytes
    - Viewed (0)
Back to top