Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 73 for KSession (0.17 sec)

  1. tests/test_tutorial/test_websockets/test_tutorial002_an_py39.py

    def test_websocket_with_cookie(app: FastAPI):
        client = TestClient(app, cookies={"session": "fakesession"})
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws") as websocket:
                message = "Message one"
                websocket.send_text(message)
                data = websocket.receive_text()
                assert data == "Session cookie or query token value is: fakesession"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_cookie_params/test_tutorial001_py310.py

            ("/items", {"ads_id": "ads_track"}, 200, {"ads_id": "ads_track"}),
            (
                "/items",
                {"ads_id": "ads_track", "session": "cookiesession"},
                200,
                {"ads_id": "ads_track"},
            ),
            ("/items", {"session": "cookiesession"}, 200, {"ads_id": None}),
        ],
    )
    def test(path, cookies, expected_status, expected_response):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/sql-databases.md

    ### ✍ `SessionLocal` πŸŽ“
    
    πŸ”  πŸ‘ `SessionLocal` πŸŽ“ πŸ”œ πŸ’½ πŸŽ‰. πŸŽ“ ⚫️ 🚫 πŸ’½ πŸŽ‰.
    
    βœ‹οΈ πŸ• πŸ‘₯ ✍ πŸ‘ `SessionLocal` πŸŽ“, πŸ‘‰ πŸ‘ πŸ”œ β˜‘ πŸ’½ πŸŽ‰.
    
    πŸ‘₯ πŸ“› ⚫️ `SessionLocal` πŸ”¬ ⚫️ βšͺ️➑️ `Session` πŸ‘₯ 🏭 βšͺ️➑️ πŸ‡ΈπŸ‡².
    
    πŸ‘₯ πŸ”œ βš™οΈ `Session` (1️⃣ πŸ—„ βšͺ️➑️ πŸ‡ΈπŸ‡²) βͺ.
    
    ✍ `SessionLocal` πŸŽ“, βš™οΈ πŸ”’ `sessionmaker`:
    
    ```Python hl_lines="11"
    {!../../../docs_src/sql_databases/sql_app/database.py!}
    ```
    
    ### ✍ `Base` πŸŽ“
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 25.2K bytes
    - Viewed (1)
  4. docs/em/docs/tutorial/dependencies/dependencies-with-yield.md

        opt raise
            dep -->> handler: Raise HTTPException
            handler -->> client: HTTP error response
            dep -->> dep: Raise other exception
        end
        dep ->> operation: Run dependency, e.g. DB session
        opt raise
            operation -->> dep: Raise HTTPException
            dep -->> handler: Auto forward exception
            handler -->> client: HTTP error response
            operation -->> dep: Raise other exception
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  5. docs/de/docs/features.md

    * API SchlΓΌssel in:
        * Header-Feldern.
        * Anfrageparametern.
        * Cookies, usw.
    
    ZusΓ€tzlich alle Sicherheitsfunktionen von Starlette (inklusive **Session Cookies**).
    
    Alles als wiederverwendbare Tools und Komponenten gebaut, die einfach in ihre Systeme, Datenspeicher, relationalen und nicht-relationalen Datenbanken, usw., integriert werden kΓΆnnen.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 19:43:43 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_sql_databases/test_sql_databases.py

        os.chdir(tmp_path)
        test_db = Path("./sql_app.db")
        if test_db.is_file():  # pragma: nocover
            test_db.unlink()
        # Import while creating the client to create the DB after starting the test session
        from docs_src.sql_databases.sql_app import main
    
        # Ensure import side effects are re-executed
        importlib.reload(main)
        with TestClient(main.app) as c:
            yield c
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.1K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py

        os.chdir(tmp_path)
        test_db = Path("./sql_app.db")
        if test_db.is_file():  # pragma: nocover
            test_db.unlink()
        # Import while creating the client to create the DB after starting the test session
        from docs_src.sql_databases.sql_app_py310 import alt_main
    
        # Ensure import side effects are re-executed
        importlib.reload(alt_main)
    
        with TestClient(alt_main.app) as c:
            yield c
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  8. docs/en/docs/release-notes.md

    ```Python
    async def get_database():
        with Session() as session:
            try:
                yield session
            except HTTPException:
                session.rollback()
                raise
            finally:
                session.close()
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:42 GMT 2024
    - 388.1K bytes
    - Viewed (1)
  9. docs_src/sql_databases/sql_app_py39/alt_main.py

    from fastapi import Depends, FastAPI, HTTPException, Request, Response
    from sqlalchemy.orm import Session
    
    from . import crud, models, schemas
    from .database import SessionLocal, engine
    
    models.Base.metadata.create_all(bind=engine)
    
    app = FastAPI()
    
    
    @app.middleware("http")
    async def db_session_middleware(request: Request, call_next):
        response = Response("Internal server error", status_code=500)
        try:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_websockets/test_tutorial002.py

    
    def test_websocket_with_cookie():
        client = TestClient(app, cookies={"session": "fakesession"})
        with pytest.raises(WebSocketDisconnect):
            with client.websocket_connect("/items/foo/ws") as websocket:
                message = "Message one"
                websocket.send_text(message)
                data = websocket.receive_text()
                assert data == "Session cookie or query token value is: fakesession"
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 13 14:26:09 GMT 2022
    - 3.6K bytes
    - Viewed (0)
Back to top