コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 6 of about 6 for arguments (0.004 sec.)
Advanced Middleware 11479
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 ... ware , some_config = "rainbow" ) app.add_middleware() receives a middleware class as the first argument and any additional arguments to be passed to the middleware. Integrated middlewares FastAPI includes several middlewares for common use cases, we'll se ... xample.com" , "*.example.com" ] ) @app . get ( "/" ) async def main (): return { "message" : "Hello World" } The following arguments are supported: allowed_hosts - A list of domain names that should be allowed as hostnames. Wildcard domains such as *.exam ... re , minimum_size = 1000 , compresslevel = 5 ) @app . get ( "/" ) async def main (): return "somebigcontent" The following arguments are supported: minimum_size - Do not GZip responses that are smaller than this minimum size in bytes. Defaults to 500 . co ...
https://man.mtool.work/fastapi/0.115/advanced/middleware/
Templates 11296
Templates Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can use any template engine you want with FastAPI . A common choice is Jinja2, the same one used by F ... e "context" dict you passed: { "id" : id } For example, with an ID of 42 , this would render: Item ID: 42 Template url_for Arguments You can also use url_for() inside of the template, it takes as arguments the same arguments that would be used by your pat ...
https://man.mtool.work/fastapi/0.115/advanced/templates/
Settings and Environment Variables 9633
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 ... in, executing the code of the function every time. So, the function below it will be executed once for each combination of arguments. And then the values returned by each of those combinations of arguments will be used again and again whenever the functio ... n is called with exactly the same combination of arguments. For example, if you have a function: @lru_cache def say_hi ( name : str , salutation : str = "Ms." ): return f "Hello { s ... ction ->> code: return stored result end In the case of our dependency get_settings() , the function doesn't even take any arguments, so it always returns the same value. That way, it behaves almost as if it was just a global variable. But as it uses a de ...
https://man.mtool.work/fastapi/0.115/advanced/settings/
Custom Docs UI Static Assets (Self-Hosting) 8317
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 ... he custom docs. You can reuse FastAPI's internal functions to create the HTML pages for the docs, and pass them the needed arguments: openapi_url : the URL where the HTML page for the docs can get the OpenAPI schema for your API. You can use here the attr ... om docs. Again, you can reuse FastAPI's internal functions to create the HTML pages for the docs, and pass them the needed arguments: openapi_url : the URL where the HTML page for the docs can get the OpenAPI schema for your API. You can use here the attr ...
https://man.mtool.work/fastapi/0.115/how-to/custom-docs-ui-assets/
Release Notes 7019
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 ... angolo . 0.108.0 Upgrades ⬆️ Upgrade Starlette to >=0.29.0,<0.33.0 , update docs and usage of templates with new Starlette arguments. Remove pin of AnyIO >=3.7.1,<4.0.0 , add support for AnyIO 4.x.x. PR #10846 by @tiangolo . 0.107.0 Upgrades ⬆️ Upgrade St ...
https://man.mtool.work/fastapi/0.115/release-notes/
Simple OAuth2 with Password and Bearer 7019
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 ... urrent_user About **user_dict UserInDB(**user_dict) means: Pass the keys and values of the user_dict directly as key-value arguments, equivalent to: UserInDB ( username = user_dict [ "username" ], email = user_dict [ "email" ], full_name = user_dict [ "fu ...
https://man.mtool.work/fastapi/0.115/tutorial/security/simple-oauth2/
PREV 1 NEXT