Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 73 for Don (0.19 sec)

  1. docs/en/docs/help-fastapi.md

    ### Don't worry about style
    
    * Don't worry too much about things like commit message styles, I will squash and merge customizing the commit manually.
    
    * Also don't worry about style rules, there are already automatized tools checking that.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 13.7K bytes
    - Viewed (0)
  2. docs_src/dependencies/tutorial008d.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again 😎")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 694 bytes
    - Viewed (0)
  3. docs_src/dependencies/tutorial008d_an.py

    from typing_extensions import Annotated
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again 😎")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 744 bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008d_an_py39.py

    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again 😎")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 734 bytes
    - Viewed (0)
  5. docs_src/handling_errors/tutorial004.py

        return PlainTextResponse(str(exc), status_code=400)
    
    
    @app.get("/items/{item_id}")
    async def read_item(item_id: int):
        if item_id == 3:
            raise HTTPException(status_code=418, detail="Nope! I don't like 3.")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 762 bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/dependencies/index.md

    You only give `Depends` a single parameter.
    
    This parameter must be something like a function.
    
    You **don't call it** directly (don't add the parenthesis at the end), you just pass it as a parameter to `Depends()`.
    
    And that function takes parameters in the same way that *path operation functions* do.
    
    !!! tip
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/extra-models.md

    * The **database model** would probably need to have a hashed password.
    
    !!! danger
        Never store user's plaintext passwords. Always store a "secure hash" that you can then verify.
    
        If you don't know, you will learn what a "password hash" is in the [security chapters](security/simple-oauth2.md#password-hashing){.internal-link target=_blank}.
    
    ## Multiple models
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (1)
  8. docs/en/docs/tutorial/path-operation-configuration.md

    ## Response Status Code
    
    You can define the (HTTP) `status_code` to be used in the response of your *path operation*.
    
    You can pass directly the `int` code, like `404`.
    
    But if you don't remember what each number code is for, you can use the shortcut constants in `status`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="1  15"
        {!> ../../../docs_src/path_operation_configuration/tutorial001_py310.py!}
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/query-params.md

    
    ## Multiple path and query parameters
    
    You can declare multiple path parameters and query parameters at the same time, **FastAPI** knows which is which.
    
    And you don't have to declare them in any specific order.
    
    They will be detected by name:
    
    === "Python 3.10+"
    
        ```Python hl_lines="6  8"
        {!> ../../../docs_src/query_params/tutorial004_py310.py!}
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Oct 20 09:08:42 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/body-nested-models.md

    But you don't have to worry about them either, incoming dicts are converted automatically and your output is converted automatically to JSON too.
    
    ## Bodies of arbitrary `dict`s
    
    You can also declare a body as a `dict` with keys of some type and values of some other type.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.5K bytes
    - Viewed (0)
Back to top