Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for from (0.19 sec)

  1. docs/en/docs/features.md

    You write standard Python with types:
    
    ```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):
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/openapi-callbacks.md

        "paid": true
    }
    ```
    
    and it would expect a response from that *external API* with a JSON body like:
    
    ```JSON
    {
        "ok": true
    }
    ```
    
    !!! tip
        Notice how the callback URL used contains the URL received as a query parameter in `callback_url` (`https://www.external.org/events`) and also the invoice `id` from inside of the JSON body (`2expen51ve`).
    
    ### Add the callback router
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/websockets.md

    ```Python hl_lines="1  46-47"
    {!../../../docs_src/websockets/tutorial001.py!}
    ```
    
    !!! note "Technical Details"
        You could also use `from starlette.websockets import WebSocket`.
    
        **FastAPI** provides the same `WebSocket` directly just as a convenience for you, the developer. But it comes directly from Starlette.
    
    ## Await for messages and send messages
    
    In your WebSocket route you can `await` for messages and send messages.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  4. docs/vi/docs/index.md

    Bây giờ sửa tệp tin `main.py` để nhận body từ một request `PUT`.
    
    Định nghĩa của body sử dụng kiểu dữ liệu chuẩn của Python, cảm ơn Pydantic.
    
    ```Python hl_lines="4  9-12  25-27"
    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: Union[bool, None] = None
    
    
    @app.get("/")
    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. requirements-tests.txt

    -e .[all]
    -r requirements-docs-tests.txt
    pytest >=7.1.3,<8.0.0
    coverage[toml] >= 6.5.0,< 8.0
    mypy ==1.8.0
    ruff ==0.2.0
    dirty-equals ==0.6.0
    # TODO: once removing databases from tutorial, upgrade SQLAlchemy
    # probably when including SQLModel
    sqlalchemy >=1.3.18,<1.4.43
    databases[sqlite] >=0.3.2,<0.7.0
    flask >=1.1.2,<3.0.0
    anyio[trio] >=3.2.1,<4.0.0
    python-jose[cryptography] >=3.3.0,<4.0.0
    pyyaml >=5.3.1,<7.0.0
    passlib[bcrypt] >=1.7.2,<2.0.0
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 23:48:42 GMT 2024
    - 496 bytes
    - Viewed (0)
  6. docs/pt/docs/index.md

    Agora modifique o arquivo `main.py` para receber um corpo para uma requisição `PUT`.
    
    Declare o corpo utilizando tipos padrão Python, graças ao Pydantic.
    
    ```Python hl_lines="4  9-12  25-27"
    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: Union[bool] = None
    
    
    @app.get("/")
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  7. docs/en/docs/fastapi-cli.md

    <font color="#3465A4">INFO    </font> Searching for package file structure from directories with <font color="#3465A4">__init__.py</font> files
    <font color="#3465A4">INFO    </font> Importing from <font color="#75507B">/home/user/code/</font><font color="#AD7FA8">awesomeapp</font>
    
     ╭─ <font color="#8AE234"><b>Python module file</b></font> ─╮
     │                      │
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri May 03 23:25:16 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  8. docs/az/docs/index.md

    Pydantic sayəsində standart Python tiplərindən istifadə edərək <abbr title="Gövdə: Body ">gövdə</abbr>ni müəyyən edək.
    
    ```Python hl_lines="4  9-12  25-27"
    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: Union[bool, None] = None
    
    
    @app.get("/")
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 22.8K bytes
    - Viewed (0)
  9. docs/yo/docs/index.md

    Ní báyìí, ṣe ìkéde kókó èsì API nínú kóòdù rẹ nipa lílo àwọn ìtọ́kasí àmì irúfẹ́ Python, ọpẹ́ pàtàkìsi sí Pydantic.
    
    ```Python hl_lines="4  9-12  25-27"
    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
        is_offer: Union[bool, None] = None
    
    
    @app.get("/")
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Mon Apr 29 05:18:04 GMT 2024
    - 24.1K bytes
    - Viewed (0)
  10. README.md

    ## Example upgrade
    
    Now modify the file `main.py` to receive a body from a `PUT` request.
    
    Declare the body using standard Python types, thanks to Pydantic.
    
    ```Python hl_lines="4  9-12  25-27"
    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: float
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 22.6K bytes
    - Viewed (0)
Back to top