Results of 1 - 6 of about 6 for directory (0.002 sec.)
- Virtual Environments 12722
- 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
...nt variable . An environment 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 t...o adopt a tool that manages everything for you (including installing Python), try uv . Create a Project First, create a directory for your project. What I normally do is that I create a directory named code inside my home/user directory. And inside of...that I create one directory per project. // Go to the home directory $ cd // Create a directory for all your code projects $ mkdir code // Enter into... - https://man.mtool.work/fastapi/0.115/virtual-environments/
- Development - Contributing 10108
- 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
...cally to test all the code and generate coverage reports in HTML: $ bash scripts/test-cov-html.sh This command generates a directory ./htmlcov/ , if you open the file ./htmlcov/index.html in your browser, you can explore interactively the regions of code...d see the changes live. Tip Alternatively, you can perform the same steps that scripts does manually. Go into the language directory, for the main docs in English it's at docs/en/ : $ cd docs/en/ Then run mkdocs in that directory: $ mkdocs serve --dev-add...ee the code in ./scripts/docs.py , you just use it in the command line. All the documentation is in Markdown format in the directory ./docs/en/ . Many of the tutorials have blocks of code. In most of the cases, these blocks of code are actual complete app... - https://man.mtool.work/fastapi/0.115/contributing/
- Bigger Applications - Multiple Files 8755
- Bigger Applications - Multiple Files Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . If you are building an application or a web API, it's rarely the case that you
...s.py │ │ └── users.py │ └── internal │ ├── __init__.py │ └── admin.py Tip There are several __init__.py files: one in each directory or subdirectory. This is what allows importing code from one file into another. For example, in app/main.py you could have...a line like: from app.routers import items The app directory contains everything. And it has an empty file app/__init__.py , so it is a "Python package" (a collection of "Python modul...es"): app . It contains an app/main.py file. As it is inside a Python package (a directory with a file __init__.py ), it is a "module" of that package: app.main . There's also an app/dependencies.py file, just lik... - https://man.mtool.work/fastapi/0.115/tutorial/bigger-applications/
- Custom Docs UI Static Assets (Self-Hosting) 8079
- 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
...le structure Let's say your 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 └── s...tatic/ Download the files 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 option similar to Save link as... . Swagger UI uses the files: swagg...taticfiles import StaticFiles app = FastAPI ( docs_url = None , redoc_url = None ) app . mount ( "/static" , StaticFiles ( directory = "static" ), name = "static" ) @app . get ( "/docs" , include_in_schema = False ) async def custom_swagger_ui_html (): re... - https://man.mtool.work/fastapi/0.115/how-to/custom-docs-ui-assets/
- 静的ファイル 7640
- 静的ファイル 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 は、開発者...マウント」されるサブパスを指します。したがって、 "/static" から始まるパスはすべてサブアプリケーションによって処理されます。 directory="static" は、静的ファイルを含むディレクトリの名前を指します。 name="static" は、 FastAPI が内部で使用できる名前を付けます。... - https://man.mtool.work/fastapi/0.115/tutorial/static-files/
- Templates 7476
- 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
...import StaticFiles from fastapi.templating import Jinja2Templates app = FastAPI () app . mount ( "/static" , StaticFiles ( directory = "static" ), name = "static" ) templates = Jinja2Templates ( directory = "templates" ) @app . get ( "/items/ {id} " , res... - https://man.mtool.work/fastapi/0.115/advanced/templates/
PREV
1
NEXT