Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 195 for inside (0.26 sec)

  1. docs/en/docs/advanced/using-request-directly.md

    But there are specific cases where it's useful to get the `Request` object.
    
    ## Use the `Request` object directly
    
    Let's imagine you want to get the client's IP address/host inside of your *path operation function*.
    
    For that you need to access the request directly.
    
    ```Python hl_lines="1  7-8"
    {!../../../docs_src/using_request_directly/tutorial001.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Aug 29 14:02:58 GMT 2020
    - 2.3K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/bigger-applications.md

    * It contains an `app/main.py` file. As it is inside a Python package (a directory with a file `__init__.py`), it is a "module" of that package: `app.main`.
    * There's also an `app/dependencies.py` file, just like `app/main.py`, it is a "module": `app.dependencies`.
    * There's a subdirectory `app/routers/` with another file `__init__.py`, so it's a "Python subpackage": `app.routers`.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 18.6K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/body-multiple-params.md

        },
        "user": {
            "username": "dave",
            "full_name": "Dave Grohl"
        }
    }
    ```
    
    !!! note
        Notice that even though the `item` was declared the same way as before, it is now expected to be inside of the body with a key `item`.
    
    
    **FastAPI** will do the automatic conversion from the request, so that the parameter `item` receives it's specific content and the same for `user`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 7.7K bytes
    - Viewed (0)
  4. docs/en/docs/python-types.md

    #### Union
    
    You can declare that a variable can be any of **several types**, for example, an `int` or a `str`.
    
    In Python 3.6 and above (including Python 3.10) you can use the `Union` type from `typing` and put inside the square brackets the possible types to accept.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17K bytes
    - Viewed (0)
  5. docs/en/docs/how-to/custom-request-and-route.md

        But this example is still valid and it shows how to interact with the internal components.
    
    We can also use this same approach to access the request body in an exception handler.
    
    All we need to do is handle the request inside a `try`/`except` block:
    
    ```Python hl_lines="13  15"
    {!../../../docs_src/custom_request_and_route/tutorial002.py!}
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 4.4K bytes
    - Viewed (0)
  6. docs/en/docs/alternatives.md

    The way it works is that you write the definition of the schema using YAML format inside the docstring of each function handling a route.
    
    And it generates OpenAPI schemas.
    
    That's how it works in Flask, Starlette, Responder, etc.
    
    But then, we have again the problem of having a micro-syntax, inside of a Python string (a big YAML).
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23.2K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/path-params.md

    ```Python hl_lines="7"
    {!../../../docs_src/path_params/tutorial002.py!}
    ```
    
    In this case, `item_id` is declared to be an `int`.
    
    !!! check
        This will give you editor support inside of your function, with error checks, completion, etc.
    
    ## Data <abbr title="also known as: serialization, parsing, marshalling">conversion</abbr>
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/body-fields.md

    # Body - Fields
    
    The same way you can declare additional validation and metadata in *path operation function* parameters with `Query`, `Path` and `Body`, you can declare validation and metadata inside of Pydantic models using Pydantic's `Field`.
    
    ## Import `Field`
    
    First, you have to import it:
    
    === "Python 3.10+"
    
        ```Python hl_lines="4"
        {!> ../../../docs_src/body_fields/tutorial001_an_py310.py!}
        ```
    
    === "Python 3.9+"
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 3.6K bytes
    - Viewed (0)
  9. docs/en/docs/how-to/nosql-databases-couchbase.md

    If you are not familiar with the `f"userprofile::{username}"`, it is a Python "<a href="https://docs.python.org/3/glossary.html#term-f-string" class="external-link" target="_blank">f-string</a>".
    
    Any variable that is put inside of `{}` in an f-string will be expanded / injected in the string.
    
    ### `dict` unpacking
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 6K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/metadata.md

    Create metadata for your tags and pass it to the `openapi_tags` parameter:
    
    ```Python hl_lines="3-16  18"
    {!../../../docs_src/metadata/tutorial004.py!}
    ```
    
    Notice that you can use Markdown inside of the descriptions, for example "login" will be shown in bold (**login**) and "fancy" will be shown in italics (_fancy_).
    
    !!! tip
        You don't have to add metadata for all the tags that you use.
    
    ### Use your tags
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Mar 31 23:52:53 GMT 2024
    - 5.8K bytes
    - Viewed (0)
Back to top