コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 10 of about 12 for provide (0.007 sec.)
Simple OAuth2 with Password and Bearer 14327
Simple OAuth2 with Password and Bearer Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Now let's build from the previous chapter and add the missing parts to have ... plementation specific. For OAuth2 they are just strings. Code to get the username and password Now let's use the utilities provided by FastAPI to handle this. OAuth2PasswordRequestForm First, import OAuth2PasswordRequestForm , and use it as a dependency ... rname in db : user_dict = db [ username ] return UserInDB ( ** user_dict ) def fake_decode_token ( token ): # This doesn't provide any security at all # Check the next version user = get_user ( fake_users_db , token ) return user async def get_current_u ... rname in db : user_dict = db [ username ] return UserInDB ( ** user_dict ) def fake_decode_token ( token ): # This doesn't provide any security at all # Check the next version user = get_user ( fake_users_db , token ) return user async def get_current_u ...
https://man.mtool.work/fastapi/0.115/tutorial/security/simple-oauth2/
Deploy FastAPI on Cloud Providers 9569
Deploy FastAPI on Cloud Providers Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use virtually any cloud provider to deploy your FastAPI application. In m ... ost of the cases, the main cloud providers have guides to deploy FastAPI with them. Cloud Providers - Sponsors Some cloud providers ✨ sponsor FastAPI ✨, this ensur ... astAPI and its ecosystem . And it shows their true commitment to FastAPI and its community (you), as they not only want to provide you a good service but also want to make sure you have a good and healthy framework , FastAPI. ? You might want to try the ...
https://man.mtool.work/fastapi/0.115/deployment/cloud/
Settings and Environment Variables 8985
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 ... s are variable (can change), like database URLs. And many could be sensitive, like secrets. For this reason it's common to provide them in environment variables that are read by the application. Tip To understand environment variables you can read Envir ... , and any conversion to a different 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 p ... _.py as you saw in Bigger Applications - Multiple Files . Settings in a dependency In some occasions it might be useful to provide the settings from a dependency, instead of having a global object with settings that is used everywhere. This could be esp ...
https://man.mtool.work/fastapi/0.115/advanced/settings/
GraphQL 8843
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 ... them with FastAPI : Strawberry ? With docs for FastAPI Ariadne With docs for FastAPI Tartiflette With Tartiflette ASGI to provide ASGI integration Graphene With starlette-graphene3 GraphQL with Strawberry If you need or want to work with GraphQL , Stra ...
https://man.mtool.work/fastapi/0.115/how-to/graphql/
Behind a Proxy 8702
Behind a Proxy Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . In some situations, you might need to use a proxy server like Traefik or Nginx with a configuration ... seen by your application. In these cases you can use root_path to configure your application. The root_path is a mechanism provided by the ASGI specification (that FastAPI is built on, through Starlette). The root_path is used to handle these specific c ... . Technical Details The ASGI specification defines a root_path for this use case. And the --root-path command line option provides that root_path . Checking the current root_path You can get the current root_path used by your application for each reque ... ello World" , "root_path" : "/api/v1" } Setting the root_path in the FastAPI app Alternatively, if you don't have a way to provide a command line option like --root-path or equivalent, you can set the root_path parameter when creating your FastAPI app: ...
https://man.mtool.work/fastapi/0.115/advanced/behind-a-proxy/
Testing Dependencies with Overrides 8702
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 ... sting. You don't want the original dependency to run (nor any of the sub-dependencies it might have). Instead, you want to provide a different dependency that will be used only during tests (possibly only some specific tests), and will provide a value t ... the original dependency was used. Use cases: external service An example could be that you have an external authentication provider that you need to call. You send it a token and it returns an authenticated user. This provider might be charging you per ... calling it might take some extra time than if you had a fixed mock user for tests. You probably want to test the external provider once, but not necessarily call it for every test that runs. In this case, you can override the dependency that calls that ...
https://man.mtool.work/fastapi/0.115/advanced/testing-dependencies/
Additional Responses in OpenAPI 8118
Additional Responses in OpenAPI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Warning This is a rather advanced topic. If you are starting with FastAPI , you mig ... ur OpenAPI instead of including it directly. This way, other applications and clients can use those JSON Schemas directly, provide better code generation tools, etc. The generated responses in the OpenAPI for this path operation will be: { "responses" : ...
https://man.mtool.work/fastapi/0.115/advanced/additional-responses/
Lifespan Events 8118
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 ... ended way to handle the startup and shutdown is using the lifespan parameter of the FastAPI app as described above. If you provide a lifespan parameter, startup and shutdown event handlers will no longer be called. It's all lifespan or all events, not b ...
https://man.mtool.work/fastapi/0.115/advanced/events/
Generate Clients 7977
Generate Clients 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 OpenAPI specification, you get automatic compatibility with many tools, ... including the automatic API docs (provided by Swagger UI). One particular advantage that is not necessarily obvious is that you can generate clients (sometimes call ... astAPI and its ecosystem . And it shows their true commitment to FastAPI and its community (you), as they not only want to provide you a good service but also want to make sure you have a good and healthy framework , FastAPI. ? For example, you might wa ...
https://man.mtool.work/fastapi/0.115/advanced/generate-clients/
OAuth2 scopes 7552
OAuth2 scopes Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use OAuth2 scopes directly with FastAPI , they are integrated to work seamlessly. This would ... ated into your OpenAPI application (and the API docs). OAuth2 with scopes is the mechanism used by many big authentication providers, like Facebook, Google, GitHub, Microsoft, Twitter, etc. They use it to provide specific permissions to users and applic ...
https://man.mtool.work/fastapi/0.115/advanced/security/oauth2-scopes/
PREV 1 2 NEXT