Search Options

Results per page
Sort
Preferred Languages
Advance

Results 131 - 140 of 1,962 for fastapi (0.07 sec)

  1. tests/test_security_http_base.py

    from fastapi import FastAPI, Security
    from fastapi.security.http import HTTPAuthorizationCredentials, HTTPBase
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    security = HTTPBase(scheme="Other")
    
    
    @app.get("/users/me")
    def read_current_user(credentials: HTTPAuthorizationCredentials = Security(security)):
        return {"scheme": credentials.scheme, "credentials": credentials.credentials}
    
    
    client = TestClient(app)
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_events/test_tutorial001.py

    import pytest
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    
    @pytest.fixture(name="app", scope="module")
    def get_app():
        with pytest.warns(DeprecationWarning):
            from docs_src.events.tutorial001 import app
        yield app
    
    
    def test_events(app: FastAPI):
        with TestClient(app) as client:
            response = client.get("/items/foo")
            assert response.status_code == 200, response.text
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 18 12:36:40 UTC 2023
    - 3.6K bytes
    - Viewed (0)
  3. tests/test_security_api_key_cookie_optional.py

    from typing import Optional
    
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyCookie
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    api_key = APIKeyCookie(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(api_key)):
        if oauth_header is None:
            return None
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  4. tests/test_security_api_key_query_optional.py

    from typing import Optional
    
    from fastapi import Depends, FastAPI, Security
    from fastapi.security import APIKeyQuery
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    api_key = APIKeyQuery(name="key", auto_error=False)
    
    
    class User(BaseModel):
        username: str
    
    
    def get_current_user(oauth_header: Optional[str] = Security(api_key)):
        if oauth_header is None:
            return None
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 2K bytes
    - Viewed (0)
  5. docs/en/docs/project-generation.md

    ## Full Stack FastAPI Template - Technology Stack and Features
    
    - ⚑ [**FastAPI**](https://fastapi.tiangolo.com) for the Python backend API.
        - 🧰 [SQLModel](https://sqlmodel.tiangolo.com) for the Python SQL database interactions (ORM).
        - πŸ” [Pydantic](https://docs.pydantic.dev), used by FastAPI, for the data validation and settings management.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Oct 04 11:16:34 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  6. docs_src/custom_response/tutorial006c.py

    from fastapi import FastAPI
    from fastapi.responses import RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/pydantic", response_class=RedirectResponse, status_code=302)
    async def redirect_pydantic():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Mar 22 01:42:11 UTC 2024
    - 237 bytes
    - Viewed (0)
  7. docs_src/extending_openapi/tutorial001.py

    from fastapi import FastAPI
    from fastapi.openapi.utils import get_openapi
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items():
        return [{"name": "Foo"}]
    
    
    def custom_openapi():
        if app.openapi_schema:
            return app.openapi_schema
        openapi_schema = get_openapi(
            title="Custom title",
            version="2.5.0",
            summary="This is a very custom OpenAPI schema",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 737 bytes
    - Viewed (0)
  8. tests/test_openapi_route_extensions.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/", openapi_extra={"x-custom-extension": "value"})
    def route_with_extras():
        return {}
    
    
    client = TestClient(app)
    
    
    def test_get_route():
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert response.json() == {}
    
    
    def test_openapi():
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jun 30 18:25:16 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  9. docs/ko/docs/tutorial/index.md

    </div>
    
    μ½”λ“œλ₯Ό μž‘μ„±ν•˜κ±°λ‚˜ 볡사, νŽΈμ§‘ν•  λ•Œ, 둜컬 ν™˜κ²½μ—μ„œ μ‹€ν–‰ν•˜λŠ” 것을 **κ°•λ ₯히 ꢌμž₯**ν•©λ‹ˆλ‹€.
    
    둜컬 νŽΈμ§‘κΈ°μ—μ„œ μ‚¬μš©ν•œλ‹€λ©΄, λͺ¨λ“  νƒ€μž… 검사와 μžλ™μ™„μ„± λ“± μž‘μ„±ν•΄μ•Ό ν•˜λŠ” μ½”λ“œκ°€ μ–Όλ§ˆλ‚˜ 적은지 λ³΄λ©΄μ„œ FastAPI의 이점을 λΉ„λ‘œμ†Œ κ²½ν—˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
    
    
    ---
    
    ## FastAPI μ„€μΉ˜
    
    첫 번째 λ‹¨κ³„λŠ” FastAPIλ₯Ό μ„€μΉ˜ν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€.
    
    μžμŠ΅μ‹œμ—λŠ” λͺ¨λ“  선택적인 μ˜μ‘΄μ„± 및 κΈ°λŠ₯을 ν•¨κ»˜ μ„€μΉ˜ν•˜λŠ” 것을 μΆ”μ²œν•©λ‹ˆλ‹€:
    
    <div class="termy">
    
    ```console
    $ pip install "fastapi[all]"
    
    ---> 100%
    ```
    
    </div>
    
    ...μ΄λŠ” μ½”λ“œλ₯Ό μ‹€ν–‰ν•˜λŠ” μ„œλ²„λ‘œ μ‚¬μš©ν•  수 μžˆλŠ” `uvicorn` λ˜ν•œ ν¬ν•¨ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Oct 04 10:57:17 UTC 2024
    - 3K bytes
    - Viewed (0)
  10. docs/em/docs/tutorial/testing.md

    **FastAPI** 🚚 🎏 `starlette.testclient` `fastapi.testclient` πŸͺ πŸ‘†, πŸ‘©β€πŸ’». βœ‹οΈ ⚫️ πŸ‘Ÿ πŸ”— βšͺ️➑️ πŸ’ƒ.
    
    ///
    
    /// tip
    
    πŸš₯ πŸ‘† πŸ’š πŸ€™ `async` πŸ”’ πŸ‘† πŸ’― ↖️ βšͺ️➑️ πŸ“¨ πŸ“¨ πŸ‘† FastAPI 🈸 (βœ… πŸ” πŸ’½ πŸ”’), βœ”οΈ πŸ‘€ [πŸ” πŸ’―](../advanced/async-tests.md){.internal-link target=_blank} 🏧 πŸ”°.
    
    ///
    
    ## 🎏 πŸ’―
    
    🎰 🈸, πŸ‘† 🎲 πŸ”œ βœ”οΈ πŸ‘† πŸ’― 🎏 πŸ“.
    
    &amp; πŸ‘† **FastAPI** 🈸 5οΈβƒ£πŸ“† ✍ πŸ“š πŸ“/πŸ•Ή, ♒️.
    
    ### **FastAPI** πŸ“± πŸ“
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.1K bytes
    - Viewed (0)
Back to top