Results of 1 - 7 of about 7 for redirect (0.003 sec.)
- Custom Docs UI Static Assets (Self-Hosting) 13432
- 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
...rom fastapi import FastAPI from fastapi.openapi.docs import ( get_redoc_html , get_swagger_ui_html , get_swagger_ui_oauth2_redirect_html , ) app = FastAPI ( docs_url = None , redoc_url = None ) @app . get ( "/docs" , include_in_schema = False ) async def..._ui_html (): return get_swagger_ui_html ( openapi_url = app . openapi_url , title = app . title + " - Swagger UI" , oauth2_redirect_url = app . swagger_ui_oauth2_redirect_url , swagger_js_url = "https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js" ,...swagger_css_url = "https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" , ) @app . get ( app . swagger_ui_oauth2_redirect_url , include_in_schema = False ) async def swagger_ui_redirect (): return get_swagger_ui_oauth2_redirect_html () @app . g... - https://man.mtool.work/fastapi/0.115/how-to/custom-docs-ui-assets/
- Configure Swagger UI 9142
- Configure Swagger UI Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can configure some extra Swagger UI parameters . To configure them, pass the swagger_ui_pa
...avicon to use. It is normally shown in the browser tab. """ ), ] = "https://fastapi.tiangolo.com/img/favicon.png" , oauth2_redirect_url : Annotated [ Optional [ str ], Doc ( """ The OAuth2 redirect URL, it is normally automatically handled by FastAPI. ""...ameters . items (): html += f " { json . dumps ( key ) } : { json . dumps ( jsonable_encoder ( value )) } , \n " if oauth2_redirect_url : html += f "oauth2RedirectUrl: window.location.origin + ' { oauth2_redirect_url } '," html += """ presets: [ SwaggerU...oc> <script src=" { redoc_js_url } "> </script> </body> </html> """ return HTMLResponse ( html ) def get_swagger_ui_oauth2_redirect_html () -> HTMLResponse : """ Generate the HTML response with the OAuth2 redirection for Swagger UI. You normally don't ne... - https://man.mtool.work/fastapi/0.115/how-to/configure-swagger-ui/
- OpenAPI docs 8542
- 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
...tapi.openapi.docs.get_swagger_ui_oauth2_redirect_html ::: fastapi.openapi.docs.swagger_ui_default_parameters... - https://man.mtool.work/fastapi/0.115/reference/openapi/docs/
- Custom Response Classes - File, HTML, Redirect, Streaming, etc. 8270
- Custom Response Classes - File, HTML, Redirect, Streaming, etc. There are several custom response classes you can use to create an instance and return them directly from your path operations . Read more about it in the FastAPI docs for Cust
...ponses : from fastapi.responses import ( FileResponse , HTMLResponse , JSONResponse , ORJSONResponse , PlainTextResponse , RedirectResponse , Response , StreamingResponse , UJSONResponse , ) FastAPI Responses There are a couple of custom FastAPI response...ype - body - background - raw_headers - render - init_headers - headers - set_cookie - delete_cookie ::: fastapi.responses.RedirectResponse options: members: - charset - status_code - media_type - body - background - raw_headers - render - init_headers -... - https://man.mtool.work/fastapi/0.115/reference/responses/
- カスタムレスポンス - HTML、ストリーム、ファイル、その他のレスポンス 8197
- カスタムレスポンス - HTML、ストリーム、ファイル、その他のレスポンス デフォルトでは、 FastAPI は JSONResponse を使ってレスポンスを返します。 レスポンスを直接返す で見たように、 Response を直接返すことでこの挙動をオーバーライドできます。 しか
...esponse ) async def read_items (): return [{ "item_id" : "Foo" }] 豆知識 ORJSONResponse のほうが高速な代替かもしれません。 RedirectResponse HTTPリダイレクトを返します。デフォルトでは307ステータスコード (Temporary Redirect) となります。 Python 3.8+ from f...astapi import FastAPI from fastapi.responses import RedirectResponse app = FastAPI () @app . get ( "/typer" ) async def redirect_typer (): return RedirectResponse ( "https://typer.tia... - https://man.mtool.work/fastapi/0.115/advanced/custom-response/
- Behind a Proxy 8051
- 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
...ervers]] url = "http://127.0.0.1:8000" This file configures Traefik to use the path prefix /api/v1 . And then Traefik will redirect its requests to your Uvicorn running on http://127.0.0.1:8000 . Now start Traefik: $ ./traefik --configFile = traefik.toml... - https://man.mtool.work/fastapi/0.115/advanced/behind-a-proxy/
- Release Notes 7924
- 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
...or courses. PR #10113 by @tiangolo . ? Update docs for generating clients. PR #10112 by @tiangolo . ? Tweak MkDocs and add redirects. PR #10111 by @tiangolo . ? Restructure docs for cloud providers, include links to sponsors. PR #10110 by @tiangolo . Int...729 by @tiangolo . ? Build and deploy docs only on docs changes. PR #9728 by @tiangolo . 0.98.0 Features ✨ Allow disabling redirect_slashes at the FastAPI app level. PR #3432 by @cyberlis . Docs ? Update docs on Pydantic using ujson internally. PR #5804... - https://man.mtool.work/fastapi/0.115/release-notes/
PREV
1
NEXT