Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 73 for arguments (0.31 sec)

  1. docs/en/docs/advanced/templates.md

    ```Python
    {"id": id}
    ```
    
    For example, with an ID of `42`, this would render:
    
    ```html
    Item ID: 42
    ```
    
    ### Template `url_for` Arguments
    
    You can also use `url_for()` inside of the template, it takes as arguments the same arguments that would be used by your *path operation function*.
    
    So, the section with:
    
    {% raw %}
    
    ```jinja
    <a href="{{ url_for('read_item', id=id) }}">
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 22:25:37 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/settings.md

    So, the function below it will be executed once for each combination of arguments. And then the values returned by each of those combinations of arguments will be used again and again whenever the function is called with exactly the same combination of arguments.
    
    For example, if you have a function:
    
    ```Python
    @lru_cache
    def say_hi(name: str, salutation: str = "Ms."):
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 15.7K bytes
    - Viewed (0)
  3. docs/en/docs/how-to/custom-docs-ui-assets.md

    ```
    
    ### Include the custom docs
    
    Now you can create the *path operations* for the custom docs.
    
    You can re-use FastAPI's internal functions to create the HTML pages for the docs, and pass them the needed arguments:
    
    * `openapi_url`: the URL where the HTML page for the docs can get the OpenAPI schema for your API. You can use here the attribute `app.openapi_url`.
    * `title`: the title of your API.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Mon Oct 30 09:58:58 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/background-tasks.md

    ```Python hl_lines="14"
    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    `.add_task()` receives as arguments:
    
    * A task function to be run in the background (`write_notification`).
    * Any sequence of arguments that should be passed to the task function in order (`email`).
    * Any keyword arguments that should be passed to the task function (`message="some notification"`).
    
    ## Dependency Injection
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/path-params-numeric-validations.md

    ...Python has a little special syntax for that.
    
    Pass `*`, as the first parameter of the function.
    
    Python won't do anything with that `*`, but it will know that all the following parameters should be called as keyword arguments (key-value pairs), also known as <abbr title="From: K-ey W-ord Arg-uments"><code>kwargs</code></abbr>. Even if they don't have a default value.
    
    ```Python hl_lines="7"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/sql-databases.md

    !!! tip
        Instead of passing each of the keyword arguments to `Item` and reading each one of them from the Pydantic *model*, we are generating a `dict` with the Pydantic *model*'s data with:
    
        `item.dict()`
    
        and then we are passing the `dict`'s key-value pairs as the keyword arguments to the SQLAlchemy `Item`, with:
    
        `Item(**item.dict())`
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  7. docs/fr/docs/tutorial/background-tasks.md

    
    ```Python hl_lines="14"
    {!../../../docs_src/background_tasks/tutorial001.py!}
    ```
    
    `.add_task()` reçoit comme arguments :
    
    * Une fonction de tâche à exécuter en arrière-plan (`write_notification`).
    * Les arguments positionnels à passer à la fonction de tâche dans l'ordre (`email`).
    * Les arguments nommés à passer à la fonction de tâche (`message="some notification"`).
    
    ## Injection de dépendances
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 5.7K bytes
    - Viewed (0)
  8. docs/en/docs/advanced/middleware.md

    from unicorn import UnicornMiddleware
    
    app = FastAPI()
    
    app.add_middleware(UnicornMiddleware, some_config="rainbow")
    ```
    
    `app.add_middleware()` receives a middleware class as the first argument and any additional arguments to be passed to the middleware.
    
    ## Integrated middlewares
    
    **FastAPI** includes several middlewares for common use cases, we'll see next how to use them.
    
    !!! note "Technical Details"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 10 18:27:10 GMT 2023
    - 4K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/cors.md

    The following arguments are supported:
    
    * `allow_origins` - A list of origins that should be permitted to make cross-origin requests. E.g. `['https://example.org', 'https://www.example.org']`. You can use `['*']` to allow any origin.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 13 20:28:37 GMT 2022
    - 5.1K bytes
    - Viewed (0)
  10. docs/en/docs/advanced/custom-response.md

    ### `FileResponse`
    
    Asynchronously streams a file as the response.
    
    Takes a different set of arguments to instantiate than the other response types:
    
    * `path` - The filepath to the file to stream.
    * `headers` - Any custom headers to include, as a dictionary.
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.7K bytes
    - Viewed (0)
Back to top