- Sort Score
- Num 10 results
- Language All
Results 131 - 140 of 1,421 for app (0.01 seconds)
-
tests/test_read_with_orm_mode.py
full_name: str model_config = {"from_attributes": True} app = FastAPI() @app.post("/people/", response_model=PersonRead) def create_person(person: PersonCreate) -> Any: db_person = Person.model_validate(person) return db_person client = TestClient(app) person_data = {"name": "Dive", "lastname": "Wilson"}Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 1.2K bytes - Click Count (0) -
docs/en/docs/advanced/middleware.md
For that, you use `app.add_middleware()` (as in the example for CORS). ```Python from fastapi import FastAPI from unicorn import UnicornMiddleware app = FastAPI() app.add_middleware(UnicornMiddleware, some_config="rainbow") ```
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 4.4K bytes - Click Count (0) -
tests/test_route_scope.py
from fastapi.routing import APIRoute, APIWebSocketRoute from fastapi.testclient import TestClient app = FastAPI() @app.get("/users/{user_id}") async def get_user(user_id: str, request: Request): route: APIRoute = request.scope["route"] return {"user_id": user_id, "path": route.path} @app.websocket("/items/{item_id}") async def websocket_item(item_id: str, websocket: WebSocket):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Mon Sep 29 03:29:38 GMT 2025 - 1.5K bytes - Click Count (0) -
docs_src/dataclasses_/tutorial003_py310.py
@dataclass class Author: name: str items: list[Item] = field(default_factory=list) # (3) app = FastAPI() @app.post("/authors/{author_id}/items/", response_model=Author) # (4) async def create_author_items(author_id: str, items: list[Item]): # (5) return {"name": author_id, "items": items} # (6) @app.get("/authors/", response_model=list[Author]) # (7) def get_authors(): # (8) return [ # (9) {Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 1.3K bytes - Click Count (0) -
docs_src/dataclasses_/tutorial003_py39.py
@dataclass class Author: name: str items: list[Item] = field(default_factory=list) # (3) app = FastAPI() @app.post("/authors/{author_id}/items/", response_model=Author) # (4) async def create_author_items(author_id: str, items: list[Item]): # (5) return {"name": author_id, "items": items} # (6) @app.get("/authors/", response_model=list[Author]) # (7) def get_authors(): # (8) return [ # (9) {Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Fri Dec 26 10:43:02 GMT 2025 - 1.4K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/first-steps.md
一個「裝飾器」會對下面的函式做一些事情。 在這種情況下,這個裝飾器告訴 **FastAPI** 那個函式對應於 **路徑** `/` 和 **操作** `get`. 這就是「**路徑操作裝飾器**」。 /// 你也可以使用其他的操作: * `@app.post()` * `@app.put()` * `@app.delete()` 以及更少見的: * `@app.options()` * `@app.head()` * `@app.patch()` * `@app.trace()` /// tip 你可以自由地使用每個操作(HTTP 方法)。 **FastAPI** 不強制任何特定的意義。 這裡的資訊作為一個指南,而不是要求。
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Oct 11 17:48:49 GMT 2025 - 11.6K bytes - Click Count (0) -
docs/ko/docs/tutorial/first-steps.md
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Oct 11 17:48:49 GMT 2025 - 10.3K bytes - Click Count (0) -
docs/de/docs/deployment/fastapicloud.md
``` </div> ## Deployen { #deploy } Stellen Sie Ihre App jetzt mit **einem einzigen Befehl** bereit: <div class="termy"> ```console $ fastapi deploy Deploying to FastAPI Cloud... ✅ Deployment successful! 🐔 Ready the chicken! Your app is ready at https://myapp.fastapicloud.dev ``` </div> Das war’s! Jetzt können Sie Ihre App unter dieser URL aufrufen. ✨Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Dec 02 17:32:56 GMT 2025 - 2.2K bytes - Click Count (0) -
docs/ru/docs/advanced/testing-dependencies.md
### Используйте атрибут `app.dependency_overrides` { #use-the-app-dependency-overrides-attribute } Для таких случаев у вашего приложения **FastAPI** есть атрибут `app.dependency_overrides`, это простой `dict`.Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Sep 30 11:37:11 GMT 2025 - 4.3K bytes - Click Count (0) -
docs/zh/docs/deployment/docker.md
COPY ./main.py /code/ # (2) CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"] ``` 1. 直接将`main.py`文件复制到`/code`目录中(不包含任何`./app`目录)。 2. 运行 Uvicorn 并告诉它从 `main` 导入 `app` 对象(而不是从 `app.main` 导入)。 然后调整Uvicorn命令使用新模块`main`而不是`app.main`来导入FastAPI 实例`app`。 ## 部署概念 我们再谈谈容器方面的一些相同的[部署概念](concepts.md){.internal-link target=_blank}。
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Mon Aug 12 21:47:53 GMT 2024 - 31.2K bytes - Click Count (0)