Results of 1 - 10 of about 17 for handle (0.003 sec.)
- Advanced Middleware 12259
- Advanced Middleware Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In the main tutorial you read how to add Custom Middleware to your application. And then you al
...so read how to handle CORS with the CORSMiddleware . In this section we'll see how to use other middlewares. Adding ASGI middlewares As FastAPI..."rainbow" ) But FastAPI (actually Starlette) provides a simpler way to do it that makes sure that the internal middlewares handle server errors and custom exception handlers work properly. For that, you use app.add_middleware() (as in the example for C...r omit the middleware. If an incoming request does not validate correctly then a 400 response will be sent. GZipMiddleware Handles GZip responses for any request that includes "gzip" in the Accept-Encoding header. The middleware will handle both standa... - https://man.mtool.work/fastapi/0.115/advanced/middleware/
- OpenAPI 11000
- OpenAPI There are several utilities to handle OpenAPI. You normally don't need to use them unless you have a specific advanced use case that requires it.
... - https://man.mtool.work/fastapi/0.115/reference/openapi/
- OpenAPI docs 10242
- OpenAPI docs Utilities to handle OpenAPI automatic UI documentation, including Swagger UI (by default at /docs ) and ReDoc (by default at /redoc ). ::: fastapi.openapi.docs.get_swagger_ui_html ::: fastapi.openapi.docs.get_redoc_html ::: fas
... - https://man.mtool.work/fastapi/0.115/reference/openapi/docs/
- Lifespan Events 9983
- Lifespan Events Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can define logic (code) that should be executed before the application starts up . This means t
...at should be executed when the application is shutting down . In this case, this code will be executed once , after having handled possibly many requests . Because this code is executed before the application starts taking requests, and right after it...e and then see how to solve it with this. Let's imagine that you have some machine learning models that you want to use to handle requests. ? The same models are shared among requests, so, it's not one model per request, or one per user or something si...e being able to run an independent part of the code. That's what we'll solve, let's load the model before the requests are handled, but only right before the application starts receiving requests, not while the code is being loaded. Lifespan You can de... - https://man.mtool.work/fastapi/0.115/advanced/events/
- Advanced Security 9983
- Advanced Security Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Additional Features There are some extra features to handle security apart from the ones covered
... - https://man.mtool.work/fastapi/0.115/advanced/security/
- Dependencies - Depends() and Security() 9983
- Dependencies - Depends() and Security() Depends() Dependencies are handled mainly with the special function Depends() that takes a callable. Here is the reference for it and its parameters. You can import it directly from fastapi : from fas
...tapi import Depends ::: fastapi.Depends Security() For many scenarios, you can handle security (authorization, authentication, etc.) with dependencies, using Depends() . But when you want to also declare OAut... - https://man.mtool.work/fastapi/0.115/reference/dependencies/
- Release Notes 9242
- Release Notes Latest Changes 0.115.11 Fixes ? Add docs examples and tests (support) for Annotated custom validations, like AfterValidator , revert #13440 . PR #13442 by @tiangolo . New docs: Query Parameters and String Validations - Custom
...tom GitHub Action. PR #13270 by @tiangolo . ? Update FastAPI People Experts script, refactor and optimize data fetching to handle rate limits. PR #13267 by @tiangolo . ⬆ Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4. PR #13251 by @dependabot[b...dflare/wrangler-action from 3.9 to 3.11. PR #12544 by @dependabot[bot] . ? Update GitHub Action to deploy docs previews to handle missing deploy comments. PR #12527 by @tiangolo . ⬆ [pre-commit.ci] pre-commit autoupdate. PR #12505 by @pre-commit-ci[bot....0. PR #12112 by @dependabot[bot] . ? Update sponsors link: Coherence. PR #12097 by @tiangolo . ? Update labeler config to handle sponsorships data. PR #12096 by @tiangolo . ? Update sponsors, remove Kong. PR #12085 by @tiangolo . ⬆ [pre-commit.ci] pre... - https://man.mtool.work/fastapi/0.115/release-notes/
- Settings and Environment Variables 8724
- Settings and Environment Variables Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In many cases your application could need some external settings or configuratio
...stand environment variables you can read Environment Variables . Types and validation These environment variables can only handle text strings, as they are external to Python and have to be compatible with other programs and the rest of the system (and...fferent type or any validation has to be done in code. Pydantic Settings Fortunately, Pydantic provides a great utility to handle these settings coming from environment variables with Pydantic: Settings management . Install pydantic-settings First, mak...'s standard library, you can read more about it in the Python docs for @lru_cache . Recap You can use Pydantic Settings to handle the settings or configurations for your application, with all the power of Pydantic models. By using a dependency you can... - https://man.mtool.work/fastapi/0.115/advanced/settings/
- Custom Request and APIRoute class 8724
- Custom Request and APIRoute class Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some cases, you may want to override the logic used by the Request and APIRout
...riate header. If there's no gzip in the header, it will not try to decompress the body. That way, the same route class can handle gzip compressed or uncompressed requests. Python 3.8+ import gzip from typing import Callable , List from fastapi import B..." ): body = gzip . decompress ( body ) self . _body = body return self . _body class GzipRoute ( APIRoute ): def get_route_handler ( self ) -> Callable : original_route_handler = super () . get_route_handler () async def custom_route_handler ( request...: Request ) -> Response : request = GzipRequest ( request . scope , request . receive ) return await original_route_handler ( request ) return custom_route_handler app = FastAPI () app . router . route_class = GzipRoute @app . post ( "/sum" ) as... - https://man.mtool.work/fastapi/0.115/how-to/custom-request-and-route/
- Custom Docs UI Static Assets (Self-Hosting) 7983
- Custom Docs UI Static Assets (Self-Hosting) Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . The API docs use Swagger UI and ReDoc , and each of those need some Jav
...to the API docs with the acquired credentials. And interact with it using the real OAuth2 authentication. Swagger UI will handle it behind the scenes for you, but it needs this "redirect" helper. Create a path operation to test it Now, to be able to t...to the API docs with the acquired credentials. And interact with it using the real OAuth2 authentication. Swagger UI will handle it behind the scenes for you, but it needs this "redirect" helper. Create a path operation to test static files Now, to be... - https://man.mtool.work/fastapi/0.115/how-to/custom-docs-ui-assets/