Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for bindIf (0.17 sec)

  1. docs_src/sql_databases/sql_app_py310/database.py

    engine = create_engine(
        SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
    )
    SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 461 bytes
    - Viewed (0)
  2. docs/en/docs/advanced/testing-database.md

    ## Create the database
    
    Because now we are going to use a new database in a new file, we need to make sure we create the database with:
    
    ```Python
    Base.metadata.create_all(bind=engine)
    ```
    
    That is normally called in `main.py`, but the line in `main.py` uses the database file `sql_app.db`, and we need to make sure we create `test.db` for the tests.
    
    So we add that line here, with the new file.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3.5K bytes
    - Viewed (0)
  3. docs/en/docs/deployment/manually.md

        ```
    
        </div>
    
    === "Hypercorn"
    
        <div class="termy">
    
        ```console
        $ hypercorn main:app --bind 0.0.0.0:80
    
        Running on 0.0.0.0:8080 over http (CTRL + C to quit)
        ```
    
        </div>
    
    !!! note
        The command `uvicorn main:app` refers to:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  4. docs_src/sql_databases/sql_app_py39/tests/test_sql_app.py

    SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db"
    
    engine = create_engine(
        SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
    )
    TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
    
    
    Base.metadata.create_all(bind=engine)
    
    
    def override_get_db():
        try:
            db = TestingSessionLocal()
            yield db
        finally:
            db.close()
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.2K bytes
    - Viewed (0)
  5. docs/em/docs/advanced/testing-database.md

        đŸĻ &amp; đŸŽ¯ 🔛 đŸŽ¯ đŸ”Ŧ 📟, đŸ‘Ĩ 🖨 âšĢī¸.
    
    ## ✍ đŸ’Ŋ
    
    ↩ī¸ 🔜 đŸ‘Ĩ 🔜 ⚙ī¸ 🆕 đŸ’Ŋ 🆕 📁, đŸ‘Ĩ đŸ’Ē ⚒ 💭 đŸ‘Ĩ ✍ đŸ’Ŋ ⏎ī¸:
    
    ```Python
    Base.metadata.create_all(bind=engine)
    ```
    
    👈 🛎 🤙 `main.py`, ✋ī¸ ⏸ `main.py` ⚙ī¸ đŸ’Ŋ 📁 `sql_app.db`, &amp; đŸ‘Ĩ đŸ’Ē ⚒ 💭 đŸ‘Ĩ ✍ `test.db` đŸ’¯.
    
    đŸ‘Ĩ 🚮 👈 ⏸ đŸ“Ĩ, ⏎ī¸ 🆕 📁.
    
    ```Python hl_lines="16"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 2.6K bytes
    - Viewed (0)
  6. docs_src/sql_databases/sql_app_py310/tests/test_sql_app.py

    SQLALCHEMY_DATABASE_URL = "sqlite:///./test.db"
    
    engine = create_engine(
        SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
    )
    TestingSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
    
    
    Base.metadata.create_all(bind=engine)
    
    
    def override_get_db():
        try:
            db = TestingSessionLocal()
            yield db
        finally:
            db.close()
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.2K bytes
    - Viewed (0)
  7. 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)
  8. docs/em/docs/deployment/server-workers.md

        * đŸ“Ĩ đŸ‘Ĩ đŸšļ‍♀ī¸ 🎓 👈 🐁 đŸ’Ē 🗄 &amp; ⚙ī¸ ⏎ī¸:
    
            ```Python
            import uvicorn.workers.UvicornWorker
            ```
    
    * `--bind`: 👉 đŸ’Ŧ 🐁 đŸ“ĸ &amp; ⛴ 👂, ⚙ī¸ ❤ (`:`) 🎏 đŸ“ĸ &amp; ⛴.
        * đŸšĨ 👆 🏃‍♂ Uvicorn 🔗, ↩ī¸ `--bind 0.0.0.0:80` (🐁 🎛) 👆 🔜 ⚙ī¸ `--host 0.0.0.0` &amp; `--port 80`.
    
    đŸ”ĸ, 👆 đŸ’Ē 👀 👈 âšĢī¸ đŸŽĻ **🕹** (🛠ī¸ 🆔) 🔠 🛠ī¸ (âšĢī¸ đŸ”ĸ).
    
    👆 đŸ’Ē 👀 👈:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  9. docs/de/docs/deployment/manually.md

        ```
    
        </div>
    
    === "Hypercorn"
    
        <div class="termy">
    
        ```console
        $ hypercorn main:app --bind 0.0.0.0:80
    
        Running on 0.0.0.0:8080 over http (CTRL + C to quit)
        ```
    
        </div>
    
    !!! warning "Achtung"
        Denken Sie daran, die Option `--reload` zu entfernen, wenn Sie diese verwendet haben.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 20:16:35 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  10. docs_src/sql_databases/sql_app_py39/database.py

    engine = create_engine(
        SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
    )
    SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 461 bytes
    - Viewed (0)
Back to top