コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 10 of about 23 for dependencies (0.005 sec.)
Bigger Applications - Multiple Files 13455
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 ... . An example file structure 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 ... 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 fil ... age │ ├── __init__.py # this file makes "app" a "Python package" │ ├── main.py # "main" module, e.g. import app.main │ ├── dependencies.py # "dependencies" module, e.g. import app.dependencies │ └── routers # "routers" is a "Python subpackage" │ │ ├── __init ...
https://man.mtool.work/fastapi/0.115/tutorial/bigger-applications/
Release Notes 12634
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 ... ion for docs/vi/docs/tutorial/static-files.md . PR #11291 by @ptt3199 . ? Add Korean translation for docs/ko/docs/tutorial/dependencies/dependencies-with-yield.md . PR #13257 by @11kkw . ? Add Vietnamese translation for docs/vi/docs/virtual-environments.md . ... for docs/ru/docs/advanced/async-tests.md . PR #13227 by @Rishat-F . ? Update Russian translation for docs/ru/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md . PR #13252 by @Rishat-F . ? Add Russian translation for docs/ru/docs/tutoria ... tra_data_types. PR #13177 by @alejsdev . ✅ Simplify tests for cookie_params. PR #13176 by @alejsdev . ✅ Simplify tests for dependencies. PR #13174 by @alejsdev . ✅ Simplify tests for body_updates. PR #13172 by @alejsdev . ✅ Simplify tests for body_nested_mod ...
https://man.mtool.work/fastapi/0.115/release-notes/
path operationデコレータの依存関係 10322
path operationデコレータの依存関係 場合によっては path operation関数 の中で依存関係の戻り値を本当に必要としないこともあります。 もしくは、依存関係が値を返さない場合もあります。 しかし、それでも実行・解決する必要があります。 このような場合、 ... path operation関数 のパラメータを Depends で宣言する代わりに、 path operation decorator に dependencies の list を追加することができます。 path operationデコレータ への dependencies の追加 path operationデコレータ はオプショナ ... ルの引数 dependencies を受け取ります。 それは Depends() の list であるべきです: Python 3.8+ - non-Annotated from fastapi import Depends , FastAP ... t-key" : raise HTTPException ( status_code = 400 , detail = "X-Key header invalid" ) return x_key @app . get ( "/items/" , dependencies = [ Depends ( verify_token ), Depends ( verify_key )]) async def read_items (): return [{ "item" : "Foo" }, { "item" : "Ba ...
https://man.mtool.work/fastapi/0.115/tutorial/dependencies/dependencies-in-path-...
Global Dependencies 10154
Global Dependencies Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . For some types of applications you might want to add dependencies to the whole application. Sim ... ilar to the way you can add dependencies to the path operation decorators , you can add them to the FastAPI application. In that case, they will be applied to all ... per-secret-key" : raise HTTPException ( status_code = 400 , detail = "X-Key header invalid" ) return x_key app = FastAPI ( dependencies = [ Depends ( verify_token ), Depends ( verify_key )]) @app . get ( "/items/" ) async def read_items (): return [{ "item" ... per-secret-key" : raise HTTPException ( status_code = 400 , detail = "X-Key header invalid" ) return x_key app = FastAPI ( dependencies = [ Depends ( verify_token ), Depends ( verify_key )]) @app . get ( "/items/" ) async def read_items (): return [{ "item" ...
https://man.mtool.work/fastapi/0.115/tutorial/dependencies/global-dependencies/
Dependencies - Depends() and Security() 9098
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 ... ends ::: fastapi.Depends Security() For many scenarios, you can handle security (authorization, authentication, etc.) with dependencies, using Depends() . But when you want to also declare OAuth2 scopes, you can use Security() instead of Depends() . You can ...
https://man.mtool.work/fastapi/0.115/reference/dependencies/
Repository Management Tasks 8646
Repository Management Tasks These are the tasks that can be performed to manage the FastAPI repository by team members . Tip This section is useful only to a handful of people, team members with permissions to manage the repository. You can ... . Normally it improves maintainability, or enables future features, etc. upgrade : Upgrades This is for upgrades to direct dependencies from the project, or extra optional dependencies, normally in pyproject.toml . So, things that would affect final users, t ... hey would end up receiving the upgrade in their code base once they update. But this is not for upgrades to internal dependencies used for development, testing, docs, etc. Those internal dependencies, normally in requirements.txt files or GitHub Action ... docs . internal : Internal Use this for changes that only affect how the repo is managed. For example upgrades to internal dependencies, changes in GitHub Actions or scripts, etc. Tip Some tools like Dependabot, will add some labels, like dependencies , but ...
https://man.mtool.work/fastapi/0.115/management-tasks/
Security Tools 8160
Security Tools When you need to declare dependencies with OAuth2 scopes you use Security() . But you still need to define what is the dependable, the callable that you pass as a parameter to Depends() or Security() . There are multiple tool ... fastapi.security.OAuth2PasswordRequestForm ::: fastapi.security.OAuth2PasswordRequestFormStrict OAuth2 Security Scopes in Dependencies ::: fastapi.security.SecurityScopes OpenID Connect ::: fastapi.security.OpenIdConnect ...
https://man.mtool.work/fastapi/0.115/reference/security/
Advanced Dependencies 7959
Advanced Dependencies Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Parameterized dependencies All the dependencies we have seen are a fixed function or class. B ... : fixed_content_included } In this case, this __call__ is what FastAPI will use to check for additional parameters and sub-dependencies, and this is what will be called to pass a value to the parameter in your path operation function later. Parameterize the ...
https://man.mtool.work/fastapi/0.115/advanced/advanced-dependencies/
HTTPConnection class 7825
HTTPConnection class When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an HTTPConnection instead of a Request or a WebSocket . You can import it from fastapi. ...
https://man.mtool.work/fastapi/0.115/reference/httpconnection/
Request class 7791
Request class You can declare a parameter in a path operation function or dependency to be of type Request and then you can access the raw request object directly, without any validation, etc. You can import it directly from fastapi : from ... fastapi import Request Tip When you want to define dependencies that should be compatible with both HTTP and WebSockets, you can define a parameter that takes an HTTPConnection instead o ...
https://man.mtool.work/fastapi/0.115/reference/request/
PREV 1 2 3 NEXT