Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 81 for inline (0.15 sec)

  1. docs/en/docs/how-to/sql-databases-peewee.md

    ```
    
    To set a value used in the current "context" (e.g. for the current request) use:
    
    ```Python
    some_var.set("new value")
    ```
    
    To get a value anywhere inside of the context (e.g. in any part handling the current request) use:
    
    ```Python
    some_var.get()
    ```
    
    ### Set context variables in the `async` dependency `reset_db_state()`
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (0)
  2. docs/fa/docs/features.md

    شما پایتون استاندارد را با استفاده از تایپ ها مینویسید:
    
    ```Python
    from datetime import date
    
    from pydantic import BaseModel
    
    # Declare a variable as a str
    # and get editor support inside the function
    def main(user_id: str):
        return user_id
    
    
    # A Pydantic model
    class User(BaseModel):
        id: int
        name: str
        joined: date
    ```
    
    که سپس میتوان به این شکل از آن استفاده کرد:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 15K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/templates.md

    # Templates
    
    You can use any template engine you want with **FastAPI**.
    
    A common choice is Jinja2, the same one used by Flask and other tools.
    
    There are utilities to configure it easily that you can use directly in your **FastAPI** application (provided by Starlette).
    
    ## Install dependencies
    
    Install `jinja2`:
    
    <div class="termy">
    
    ```console
    $ pip install jinja2
    
    ---> 100%
    ```
    
    </div>
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 22:25:37 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  4. docs/tr/docs/index.md

    "_Python ile kullanıma hazır bir API oluşturmak isteyen herhangi biri için, **FastAPI**'ı şiddetle tavsiye ederim. **Harika tasarlanmış**, **kullanımı kolay** ve **yüksek ölçeklenebilir**, API odaklı geliştirme stratejimizin **ana bileşeni** haline geldi ve Virtual TAC Engineer gibi birçok otomasyon ve servisi yönetiyor._"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 21.9K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/sql-databases.md

    The first step is to create a SQLAlchemy "engine".
    
    We will later use this `engine` in other places.
    
    ```Python hl_lines="8-10"
    {!../../../docs_src/sql_databases/sql_app/database.py!}
    ```
    
    #### Note
    
    The argument:
    
    ```Python
    connect_args={"check_same_thread": False}
    ```
    
    ...is needed only for `SQLite`. It's not needed for other databases.
    
    !!! info "Technical Details"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  6. docs_src/sql_databases/sql_app/tests/test_sql_app.py

    from fastapi.testclient import TestClient
    from sqlalchemy import create_engine
    from sqlalchemy.orm import sessionmaker
    from sqlalchemy.pool import StaticPool
    
    from ..database import Base
    from ..main import app, get_db
    
    SQLALCHEMY_DATABASE_URL = "sqlite://"
    
    engine = create_engine(
        SQLALCHEMY_DATABASE_URL,
        connect_args={"check_same_thread": False},
        poolclass=StaticPool,
    )
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jun 22 11:20:12 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  7. docs_src/sql_databases/sql_app/database.py

    from sqlalchemy import create_engine
    from sqlalchemy.ext.declarative import declarative_base
    from sqlalchemy.orm import sessionmaker
    
    SQLALCHEMY_DATABASE_URL = "sqlite:///./sql_app.db"
    # SQLALCHEMY_DATABASE_URL = "postgresql://user:password@postgresserver/db"
    
    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: Sun Apr 05 11:53:09 GMT 2020
    - 461 bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    If you used to rely on this behavior, now you should create the resources for background tasks inside the background task itself, and use internally only data that doesn't depend on the resources of dependencies with `yield`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  9. docs_src/sql_databases/sql_app_py310/main.py

    from fastapi import Depends, FastAPI, HTTPException
    from sqlalchemy.orm import Session
    
    from . import crud, models, schemas
    from .database import SessionLocal, engine
    
    models.Base.metadata.create_all(bind=engine)
    
    app = FastAPI()
    
    
    # Dependency
    def get_db():
        db = SessionLocal()
        try:
            yield db
        finally:
            db.close()
    
    
    @app.post("/users/", response_model=schemas.User)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.6K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/additional-responses.md

    href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#responseObject" class="external-link" target="_blank">OpenAPI Response Object</a>, you can include anything from this directly in each response inside your `responses` parameter. Including `description`, `headers`, `content` (inside of this is that you declare different media types and JSON Schemas), and `links`....
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 8.8K bytes
    - Viewed (0)
Back to top