コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 10 of about 18 for Files (0.004 sec.)
Request Files 14944
Request Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . You can define files to be uploaded by the client using File . Info To receive uploaded files, first ... rtual environment , activate it, and then install it, for example: $ pip install python-multipart This is because uploaded files are sent as "form data". Import File Import File and UploadFile from fastapi : Python 3.9+ from typing import Annotated fr ... om fastapi import FastAPI , File , UploadFile app = FastAPI () @app . post ( "/files/" ) async def create_file ( file : Annotated [ bytes , File ()]): return { "file_size" : len ( file )} @app . post ( "/upl ... d from fastapi import FastAPI , File , UploadFile from typing_extensions import Annotated app = FastAPI () @app . post ( "/files/" ) async def create_file ( file : Annotated [ bytes , File ()]): return { "file_size" : len ( file )} @app . post ( "/upl ...
https://man.mtool.work/fastapi/0.115/tutorial/request-files/
Custom Docs UI Static Assets (Self-Hosting) 9883
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 ... aScript and CSS files. By default, those files are served from a CDN . But it's possible to customize it, you can set a specific CDN, or serve t ... he files yourself. Custom CDN for JavaScript and CSS Let's say that you want to use a different CDN , for example you want to use h ... o keep working even while offline, without open Internet access, or in a local network. Here you'll see how to serve those files yourself, in the same FastAPI app, and configure the docs to use them. Project file structure Let's say your project file ...
https://man.mtool.work/fastapi/0.115/how-to/custom-docs-ui-assets/
Static Files - StaticFiles 9368
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/
Development - Contributing 9162
Development - Contributing Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . First, you might want to see the basic ways to help FastAPI and get help . Developing If ... tecting changes It will serve the documentation on http://127.0.0.1:8008 . That way, you can edit the documentation/source files and see the changes live. Tip Alternatively, you can perform the same steps that scripts does manually. Go into the langua ... ete applications that can be run as is. In fact, those blocks of code are not written inside the Markdown, they are Python files in the ./docs_src/ directory. And those Python files are included/injected in the documentation when generating the site. ... Docs for tests Most of the tests actually run against the example source files in the documentation. This helps to make sure that: The documentation is up-to-date. The documentation examples can be run ...
https://man.mtool.work/fastapi/0.115/contributing/
リクエストフォームとファイル 8922
リクエストフォームとファイル File と Form を同時に使うことでファイルとフォームフィールドを定義することができます。 情報 アップロードされたファイルやフォームデータを受信するには、まず python-multipart をインストールします。 例えば、 pip inst ... ンポート Python 3.8+ - non-Annotated from fastapi import FastAPI , File , Form , UploadFile app = FastAPI () @app . post ( "/files/" ) async def create_file ( file : bytes = File (), fileb : UploadFile = File (), token : str = Form () ): return { "file_ ... 3.8+ from typing import Annotated from fastapi import FastAPI , File , Form , UploadFile app = FastAPI () @app . post ( "/files/" ) async def create_file ( file : Annotated [ bytes , File ()], fileb : Annotated [ UploadFile , File ()], token : Annota ... fastapi import FastAPI , File , Form , UploadFile from typing_extensions import Annotated app = FastAPI () @app . post ( "/files/" ) async def create_file ( file : Annotated [ bytes , File ()], fileb : Annotated [ UploadFile , File ()], token : Annota ...
https://man.mtool.work/fastapi/0.115/tutorial/request-forms-and-files/
Release Notes 8802
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 ... utorial/header-params.md . PR #13381 by @valentinDruzhinin . ? Add Ukrainian translation for docs/uk/docs/tutorial/request-files.md . PR #13395 by @valentinDruzhinin . ? Add Ukrainian translation for docs/uk/docs/tutorial/request-form-models.md . PR # ... 13384 by @valentinDruzhinin . ? Add Ukrainian translation for docs/uk/docs/tutorial/request-forms-and-files.md . PR #13386 by @valentinDruzhinin . ? Update Korean translation for docs/ko/docs/help-fastapi.md . PR #13262 by @Zerohe ... /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.md . ...
https://man.mtool.work/fastapi/0.115/release-notes/
Repository Management Tasks 8630
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 ... internal dependencies used for development, testing, docs, etc. Those internal dependencies, normally in requirements.txt files or GitHub Action versions should be marked as internal , not upgrade . docs : Docs Changes in docs. This includes updating ... he docs, fixing typos. But it doesn't include changes to translations. You can normally quickly detect it by going to the "Files changed" tab in the PR and checking if the updated file(s) starts with docs/en/docs . The original version of the docs is ... o in docs/en/docs . lang-all : Translations Use this for translations. You can normally quickly detect it by going to the "Files changed" tab in the PR and checking if the updated file(s) starts with docs/{some lang}/docs but not docs/en/docs . For ex ...
https://man.mtool.work/fastapi/0.115/management-tasks/
環境変数 8270
環境変数 Tip もし、「環境変数」とは何か、それをどう使うかを既に知っている場合は、このセクションをスキップして構いません。 環境変数( env var とも呼ばれる)はPythonコードの 外側 、つまり OS に存在する変数で、Pythonから読み取ることができます。 ... ムを見つけるために以下のディレクトリを探す、ということを意味します: /usr/local/bin /usr/bin /bin /usr/sbin /sbin C:\Program Files\Python312\Scripts;C:\Program Files\Python312;C:\Windows\System32 これは、OSはプログラムを見つけるために以下のディレクトリを ... 探す、ということを意味します: C:\Program Files\Python312\Scripts C:\Program Files\Python312 C:\Windows\System32 ターミナル上で コマンド を入力すると、 OSはそのプログラム ... えると、 PATH 環境変数に C:\opt\custompython\bin が追加されます。 PATH 環境変数は以下のように更新されるでしょう: C:\Program Files\Python312\Scripts;C:\Program Files\Python312;C:\Windows\System32;C:\opt\custompython\bin このようにして、ターミナルで pyth ...
https://man.mtool.work/fastapi/0.115/environment-variables/
パスパラメータ 8064
パスパラメータ Pythonのformat文字列と同様のシンタックスで「パスパラメータ」や「パス変数」を宣言できます: Python 3.8+ from fastapi import FastAPI app = FastAPI () @app . get ( "/items/ {item_id} " ) async def read_item ( item_id ): return { ... 様なJSONレスポンスを得ます: { "model_name" : "alexnet" , "message" : "Deep Learning FTW!" } パスを含んだパスパラメータ パス /files/{file_path} となる path operation を持っているとしましょう。 ただし、 home/johndoe/myfile.txt のような パス を含んだ file_ ... path が必要です。 したがって、URLは /files/home/johndoe/myfile.txt の様になります。 OpenAPIサポート OpenAPIはテストや定義が困難なシナリオにつながる可能性があるため、 ... ます。 パス変換 Starletteのオプションを直接使用することで、以下のURLの様な パス を含んだ、 パスパラメータ の宣言ができます: /files/{file_path:path} この場合、パラメータ名は file_path です。そして、最後の部分 :path はパラメータがいかなる パス にもマッチす ...
https://man.mtool.work/fastapi/0.115/tutorial/path-params/
Virtual Environments 7909
Virtual Environments Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . When you work in Python projects you probably should use a virtual environment (or a similar m ... ironment variable is a variable in the system that can be used by programs. A virtual environment is a directory with some files in it. Info This page will teach you how to use virtual environments and how they work. If you are ready to adopt a tool t ... me with your operating system. Where are Packages Installed When you install Python, it creates some directories with some files in your computer. Some of these directories are the ones in charge of having all the packages you install. When you run: / ... tandard]" ---> 100% That will download a compressed file with the FastAPI code, normally from PyPI . It will also download files for other packages that FastAPI depends on. Then it will extract all those files and put them in a directory in your compu ...
https://man.mtool.work/fastapi/0.115/virtual-environments/
PREV 1 2 NEXT