- Sort Score
- Num 10 results
- Language All
Results 141 - 150 of 1,432 for app (0.01 seconds)
-
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) -
docs/es/docs/tutorial/testing.md
### Archivo de aplicación **FastAPI** { #fastapi-app-file } Digamos que tienes una estructura de archivos como se describe en [Aplicaciones Más Grandes](bigger-applications.md){.internal-link target=_blank}: ``` . ├── app │ ├── __init__.py │ └── main.py ``` En el archivo `main.py` tienes tu aplicación de **FastAPI**:Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 6.5K bytes - Click Count (0) -
tests/test_compat.py
field = v2.ModelField(name="foo", field_info=field_info) assert field.default is Undefined def test_complex(): app = FastAPI() @app.post("/") def foo(foo: Union[str, list[int]]): return foo client = TestClient(app) response = client.post("/", json="bar") assert response.status_code == 200, response.text assert response.json() == "bar"
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 12:54:56 GMT 2025 - 4.2K bytes - Click Count (0) -
tests/test_pydanticv2_dataclasses_uuid_stringified_annotations.py
tax: Union[float, None] = None app = FastAPI() @app.get("/item", response_model=Item) async def read_item(): return { "id": uuid.uuid4(), "name": "Island In The Moon", "price": 12.99, "description": "A place to be be playin' and havin' fun", "tags": ["breater"], } client = TestClient(app) def test_annotations():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 21:25:59 GMT 2025 - 1.1K bytes - Click Count (0) -
docs/ru/docs/deployment/docker.md
COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt COPY ./app /code/app CMD ["fastapi", "run", "app/main.py", "--port", "80"] # Если запускаете за прокси, например Nginx или Traefik, добавьте --proxy-headers # CMD ["fastapi", "run", "app/main.py", "--port", "80", "--proxy-headers"] ``` </details> ## Что такое контейнер { #what-is-a-container }
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Tue Sep 30 11:24:39 GMT 2025 - 44.7K bytes - Click Count (0) -
docs_src/app_testing/app_b_an_py310/main.py
"foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"}, "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"}, } app = FastAPI() class Item(BaseModel): id: str title: str description: str | None = None @app.get("/items/{item_id}", response_model=Item) async def read_main(item_id: str, x_token: Annotated[str, Header()]): if x_token != fake_secret_token:
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Thu Aug 15 22:31:16 GMT 2024 - 1.1K bytes - Click Count (0) -
docs_src/path_params/tutorial003b_py39.py
from fastapi import FastAPI app = FastAPI() @app.get("/users") async def read_users(): return ["Rick", "Morty"] @app.get("/users") async def read_users2():
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 193 bytes - Click Count (0) -
tests/test_annotated.py
from fastapi import APIRouter, FastAPI, Query from fastapi.testclient import TestClient app = FastAPI() @app.get("/default") async def default(foo: Annotated[str, Query()] = "foo"): return {"foo": foo} @app.get("/required") async def required(foo: Annotated[str, Query(min_length=1)]): return {"foo": foo} @app.get("/multiple") async def multiple(foo: Annotated[str, object(), Query(min_length=1)]):
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Sat Dec 27 18:19:10 GMT 2025 - 9.6K bytes - Click Count (0) -
tests/test_tutorial/test_events/test_tutorial002.py
import pytest from fastapi import FastAPI from fastapi.testclient import TestClient @pytest.fixture(name="app", scope="module") def get_app(): with pytest.warns(DeprecationWarning): from docs_src.events.tutorial002_py39 import app yield app def test_events(app: FastAPI): with TestClient(app) as client: response = client.get("/items/") assert response.status_code == 200, response.text
Created: Sun Dec 28 07:19:09 GMT 2025 - Last Modified: Wed Dec 17 20:41:43 GMT 2025 - 1.4K bytes - Click Count (0)