コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 9 of about 9 for router (0.004 sec.)
Bigger Applications - Multiple Files 13085
Bigger Applications - Multiple Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . If you are building an application or a web API, it's rarely the case that you ... cture Let's say you have a file structure like this: . ├── app │ ├── __init__.py │ ├── main.py │ ├── dependencies.py │ └── routers │ │ ├── __init__.py │ │ ├── items.py │ │ └── users.py │ └── internal │ ├── __init__.py │ └── admin.py Tip There are sever ... is what allows importing code from one file into another. For example, in app/main.py you could have a line like: from app.routers import items The app directory contains everything. And it has an empty file app/__init__.py , so it is a "Python package ... 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 . The file app/routers/items.py is inside a p ...
https://man.mtool.work/fastapi/0.115/tutorial/bigger-applications/
OpenAPI Callbacks 10659
OpenAPI Callbacks Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You could create an API with a path operation that could trigger a request to an external API cre ... normal, most of the code is probably already familiar to you: Python 3.8+ from typing import Union from fastapi import APIRouter , FastAPI from pydantic import BaseModel , HttpUrl app = FastAPI () class Invoice ( BaseModel ): id : str title : Union [ ... ceEvent ( BaseModel ): description : str paid : bool class InvoiceEventReceived ( BaseModel ): ok : bool invoices_callback_router = APIRouter () @invoices_callback_router . post ( "{$callback_url}/invoices/{$request.body.id}" , response_model = Invoice ... ceived ) def invoice_notification ( body : InvoiceEvent ): pass @app . post ( "/invoices/" , callbacks = invoices_callback_router . routes ) def create_invoice ( invoice : Invoice , callback_url : Union [ HttpUrl , None ] = None ): """ Create an invoic ...
https://man.mtool.work/fastapi/0.115/advanced/openapi-callbacks/
Custom Request and APIRoute class 10084
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 ... e , request . receive ) return await original_route_handler ( request ) return custom_route_handler app = FastAPI () app . router . route_class = GzipRoute @app . post ( "/sum" ) async def sum_numbers ( numbers : List [ int ] = Body ()): return { "sum" ... e , request . receive ) return await original_route_handler ( request ) return custom_route_handler app = FastAPI () app . router . route_class = GzipRoute @app . post ( "/sum" ) async def sum_numbers ( numbers : List [ int ] = Body ()): return { "sum" ... decode ()} raise HTTPException ( status_code = 422 , detail = detail ) return custom_route_handler app = FastAPI () app . router . route_class = ValidationErrorLoggingRoute @app . post ( "/" ) async def sum_numbers ( numbers : List [ int ] = Body ()): ...
https://man.mtool.work/fastapi/0.115/how-to/custom-request-and-route/
APIRouter class 8088
APIRouter class Here's the reference information for the APIRouter class, with all its parameters, attributes and methods. You can import the APIRouter class directly from fastapi : from fastapi import APIRouter ::: fastapi.APIRouter option ... s: members: - websocket - include_router - get - put - post - delete - options - head - patch - trace - on_event ...
https://man.mtool.work/fastapi/0.115/reference/apirouter/
FastAPI class 8052
FastAPI class Here's the reference information for the FastAPI class, with all its parameters, attributes and methods. You can import the FastAPI class directly from fastapi : from fastapi import FastAPI ::: fastapi.FastAPI options: members ... : - openapi_version - webhooks - state - dependency_overrides - openapi - websocket - include_router - get - put - post - delete - options - head - patch - trace - on_event - middleware - exception_handler ...
https://man.mtool.work/fastapi/0.115/reference/fastapi/
プロジェクト生成 - テンプレート 7855
プロジェクト生成 - テンプレート プロジェクトジェネレーターは、初期設定、セキュリティ、データベース、初期APIエンドポイントなどの多くが含まれているため、プロジェクトの開始に利用できます。 プロジェクトジェネレーターは常に非常に意見が分かれる設 ... ュー。 ログイン後の、メインダッシュボードビュー。 メインダッシュボードでのユーザー作成と編集。 セルフユーザー版 Vuex 。 Vue-router 。 美しいマテリアルデザインコンポーネントのための Vuetify 。 TypeScript 。 Nginx ベースのDockerサーバ (Vue-routerとうまく協 ...
https://man.mtool.work/fastapi/0.115/project-generation/
GraphQL 7819
GraphQL Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . As FastAPI is based on the ASGI standard, it's very easy to integrate any GraphQL library also compatible w ... e Strawberry with FastAPI: Python 3.8+ import strawberry from fastapi import FastAPI from strawberry.fastapi import GraphQLRouter @strawberry . type class User : name : str age : int @strawberry . type class Query : @strawberry . field def user ( self ... -> User : return User ( name = "Patrick" , age = 100 ) schema = strawberry . Schema ( query = Query ) graphql_app = GraphQLRouter ( schema ) app = FastAPI () app . include_router ( graphql_app , prefix = "/graphql" ) You can learn more about Strawberry ...
https://man.mtool.work/fastapi/0.115/how-to/graphql/
Testing Dependencies with Overrides 7621
Testing Dependencies with Overrides Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Overriding dependencies during testing There are some scenarios where you might ... could be used in a path operation function , a path operation decorator (when you don't use the return value), a .include_router() call, etc. FastAPI will still be able to override it. Then you can reset your overrides (remove them) by setting app.dep ...
https://man.mtool.work/fastapi/0.115/advanced/testing-dependencies/
Release Notes 7549
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 ... . It's just a checkpoint. ? Refactors ♻️ Refactor deciding if embed body fields, do not overwrite fields, compute once per router, refactor internals in preparation for Pydantic models in Form , Query and others. PR #12117 by @tiangolo . Internal ⏪️ Te ... 0.112.2 Fixes ? Fix allow_inf_nan option for Param and Body classes. PR #11867 by @giunio-prc . ? Ensure that app.include_router merges nested lifespans. PR #9630 by @Lancetnik . Refactors ? Fix typing annotation for semi-internal FastAPI.add_api_rout ... pendencies-with-yield.md . PR #11848 by @Joao-Pedro-P-Holanda . ? Add Portuguese translation for docs/pt/docs/reference/apirouter.md . PR #11843 by @lucasbalieiro . Internal ? Update sponsors: add liblab. PR #11934 by @tiangolo . ? Update GitHub Action ...
https://man.mtool.work/fastapi/0.115/release-notes/
PREV 1 NEXT