Results of 1 - 6 of about 6 for Static (0.003 sec.)
- Custom Docs UI Static Assets (Self-Hosting) 12484
- 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
...ur project file structure looks like this: . ├── app │ ├── __init__.py │ ├── main.py Now create a directory to store those static files. Your new file structure could look like this: . ├── app │ ├── __init__.py │ ├── main.py └── static/ Download the fi...les Download the static files needed for the docs and put them on that static/ directory. You can probably right-click each link and select an opt...e file: redoc.standalone.js After that, your file structure could look like: . ├── app │ ├── __init__.py │ ├── main.py └── static ├── redoc.standalone.js ├── swagger-ui-bundle.js └── swagger-ui.css Serve the static files Import StaticFiles . "Mount" a... - https://man.mtool.work/fastapi/0.115/how-to/custom-docs-ui-assets/
- Templates 9706
- 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
...Jinja2 template. Python 3.8+ from fastapi import FastAPI , Request from fastapi.responses import HTMLResponse from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates app = FastAPI () app . mount ( "/static" , StaticFi...les ( directory = "static" ), name = "static" ) templates = Jinja2Templates ( directory = "templates" ) @app . get ( "/items/ {id} " , response_clas...nience for you, the developer. But most of the available responses come directly from Starlette. The same with Request and StaticFiles . Writing templates Then you can write a template at templates/item.html with, for example: <html> <head> <title>Item... - https://man.mtool.work/fastapi/0.115/advanced/templates/
- 静的ファイル 9413
- 静的ファイル StaticFiles を使用して、ディレクトリから静的ファイルを自動的に提供できます。 StaticFiles の使用 StaticFiles をインポート。 StaticFiles() インスタンスを生成し、特定のパスに「マウント」。 Python 3.8+ from fastapi import FastAPI f
...rom fastapi.staticfiles import StaticFiles app = FastAPI () app . mount ( "/static" , StaticFiles ( directory = "static" ), name = "static" )...技術詳細 from starlette.staticfiles import StaticFiles も使用できます。 FastAPI は、開発者の利便性のために、 starlette.staticfiles と同じ fastapi.staticf...されたアプリケーションの内容などは含まれません。 これについて詳しくは、 高度なユーザーガイド をご覧ください。 詳細 最初の "/static" は、この「サブアプリケーション」が「マウント」されるサブパスを指します。したがって、 "/static" から始まるパスはすべてサブ... - https://man.mtool.work/fastapi/0.115/tutorial/static-files/
- Static Files - StaticFiles 9029
- Static Files - StaticFiles You can use the StaticFiles class to serve static files, like JavaScript, CSS, images, etc. Read more about it in the FastAPI docs for Static Files . You can import it directly from fastapi.staticfiles : from fast
...api.staticfiles import StaticFiles ::: fastapi.staticfiles.StaticFiles... - https://man.mtool.work/fastapi/0.115/reference/staticfiles/
- Release Notes 7165
- 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
...ru/docs/advanced/response-cookies.md . PR #13327 by @Stepakinoyan . ? Add Vietnamese translation for docs/vi/docs/tutorial/static-files.md . PR #11291 by @ptt3199 . ? Add Korean translation for docs/ko/docs/tutorial/dependencies/dependencies-with-yield...n for docs/vi/docs/virtual-environments.md . PR #13282 by @ptt3199 . ? Add Ukrainian translation for docs/uk/docs/tutorial/static-files.md . PR #13285 by @valentinDruzhinin . ? Add Vietnamese translation for docs/vi/docs/environment-variables.md . PR #...e123 . Refactors ✅ Simplify tests for body_multiple_params . PR #13237 by @alejsdev . ♻️ Move duplicated code portion to a static method in the APIKeyBase super class. PR #3142 by @ShahriyarR . ✅ Simplify tests for request_files. PR #13182 by @alejsdev... - https://man.mtool.work/fastapi/0.115/release-notes/
- Configure Swagger UI 7000
- 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
...Configure Swagger UI](https://fastapi.tiangolo.com/how-to/configure-swagger-ui/) and the [FastAPI docs for Custom Docs UI Static Assets (Self-Hosting)](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/). """ current_swagger_ui_parameters = sw...for example the URLs to use to load ReDoc's JavaScript and CSS. Read more about it in the [FastAPI docs for Custom Docs UI Static Assets (Self-Hosting)](https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/). """ html = f """ <!DOCTYPE html> <html... - https://man.mtool.work/fastapi/0.115/how-to/configure-swagger-ui/
PREV
1
NEXT