Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 87 for specify (0.16 sec)

  1. docs/en/docs/deployment/versions.md

    ## Pin your `fastapi` version
    
    The first thing you should do is to "pin" the version of **FastAPI** you are using to the specific latest version that you know works correctly for your application.
    
    For example, let's say you are using version `0.45.0` in your app.
    
    If you use a `requirements.txt` file you could specify the version with:
    
    ```txt
    fastapi==0.45.0
    ```
    
    that would mean that you would use exactly the version `0.45.0`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Nov 05 20:50:37 GMT 2020
    - 3.3K bytes
    - Viewed (0)
  2. tests/test_ambiguous_params.py

            match=(
                "Cannot specify `Depends` in `Annotated` and default value"
                " together for 'foo'"
            ),
        ):
    
            @app.get("/")
            async def get2(foo: Annotated[int, Depends(dep)] = Depends(dep)):
                pass  # pragma: nocover
    
        with pytest.raises(
            AssertionError,
            match=(
                "Cannot specify a FastAPI annotation in `Annotated` and `Depends` as a"
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Dec 12 00:22:47 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  3. docs/en/docs/tutorial/cors.md

    So, for everything to work correctly, it's better to specify explicitly the allowed origins.
    
    ## Use `CORSMiddleware`
    
    You can configure it in your **FastAPI** application using the `CORSMiddleware`.
    
    * Import `CORSMiddleware`.
    * Create a list of allowed origins (as strings).
    * Add it as a "middleware" to your **FastAPI** application.
    
    You can also specify if your backend allows:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sun Nov 13 20:28:37 GMT 2022
    - 5.1K bytes
    - Viewed (0)
  4. docs/en/docs/tutorial/extra-data-types.md

            * In responses, the `set` will be converted to a `list`.
            * The generated schema will specify that the `set` values are unique (using JSON Schema's `uniqueItems`).
    * `bytes`:
        * Standard Python `bytes`.
        * In requests and responses will be treated as `str`.
        * The generated schema will specify that it's a `str` with `binary` "format".
    * `Decimal`:
        * Standard Python `Decimal`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  5. fastapi/dependencies/utils.py

            ]
            fastapi_specific_annotations = [
                arg
                for arg in fastapi_annotations
                if isinstance(arg, (params.Param, params.Body, params.Depends))
            ]
            if fastapi_specific_annotations:
                fastapi_annotation: Union[
                    FieldInfo, params.Depends, None
                ] = fastapi_specific_annotations[-1]
            else:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:52:56 GMT 2024
    - 29.5K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/response-status-code.md

    # Response Status Code
    
    The same way you can specify a response model, you can also declare the HTTP status code used for the response with the parameter `status_code` in any of the *path operations*:
    
    * `@app.get()`
    * `@app.post()`
    * `@app.put()`
    * `@app.delete()`
    * etc.
    
    ```Python hl_lines="6"
    {!../../../docs_src/response_status_code/tutorial001.py!}
    ```
    
    !!! note
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 29 14:02:58 GMT 2020
    - 4K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/path-operation-configuration.md

        ```
    
    It will be used in the interactive docs:
    
    <img src="/img/tutorial/path-operation-configuration/image02.png">
    
    ## Response description
    
    You can specify the response description with the parameter `response_description`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="19"
        {!> ../../../docs_src/path_operation_configuration/tutorial005_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)
  8. docs/en/docs/advanced/async-tests.md

    Let's look at how we can make that work.
    
    ## pytest.mark.anyio
    
    If we want to call asynchronous functions in our tests, our test functions have to be asynchronous. AnyIO provides a neat plugin for this, that allows us to specify that some test functions are to be called asynchronously.
    
    ## HTTPX
    
    Even if your **FastAPI** application uses normal `def` functions instead of `async def`, it is still an `async` application underneath.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Jan 13 12:07:15 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  9. fastapi/security/oauth2.py

        for an OAuth2 password flow.
    
        The OAuth2 specification dictates that for a password flow the data should be
        collected using form data (instead of JSON) and that it should have the specific
        fields `username` and `password`.
    
        All the initialization parameters are extracted from the request.
    
        Read more about it in the
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  10. docs/en/docs/tutorial/static-files.md

    # Static Files
    
    You can serve static files automatically from a directory using `StaticFiles`.
    
    ## Use `StaticFiles`
    
    * Import `StaticFiles`.
    * "Mount" a `StaticFiles()` instance in a specific path.
    
    ```Python hl_lines="2  6"
    {!../../../docs_src/static_files/tutorial001.py!}
    ```
    
    !!! note "Technical Details"
        You could also use `from starlette.staticfiles import StaticFiles`.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 19:56:09 GMT 2024
    - 1.6K bytes
    - Viewed (0)
Back to top