- Sort Score
- Result 10 results
- Languages All
Results 891 - 900 of 1,962 for fastapi (0.1 sec)
-
docs_src/response_model/tutorial002_py310.py
from fastapi import FastAPI from pydantic import BaseModel, EmailStr app = FastAPI() class UserIn(BaseModel): username: str password: str email: EmailStr full_name: str | None = None # Don't do this in production! @app.post("/user/") async def create_user(user: UserIn) -> UserIn:
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Jan 07 13:45:48 UTC 2023 - 318 bytes - Viewed (0) -
docs/zh/docs/deployment/versions.md
添加测试后,你可以将 **FastAPI** 版本升级到更新版本,并通过运行测试来确保所有代码都能正常工作。 如果一切正常,或者在进行必要的更改之后,并且所有测试都通过了,那么你可以将`fastapi`固定到新的版本。 ## 关于Starlette 你不应该固定`starlette`的版本。 不同版本的 **FastAPI** 将使用特定的较新版本的 Starlette。 因此,**FastAPI** 自己可以使用正确的 Starlette 版本。 ## 关于 Pydantic Pydantic 包含针对 **FastAPI** 的测试及其自己的测试,因此 Pydantic 的新版本(`1.0.0`以上)始终与 FastAPI 兼容。 你可以将 Pydantic 固定到适合你的`1.0.0`以上和`2.0.0`以下的任何版本。 例如: ````txt
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Aug 06 04:48:30 UTC 2024 - 3.1K bytes - Viewed (0) -
docs_src/cookie_param_models/tutorial002_an_py310.py
from typing import Annotated from fastapi import Cookie, FastAPI from pydantic import BaseModel app = FastAPI() class Cookies(BaseModel): model_config = {"extra": "forbid"} session_id: str fatebook_tracker: str | None = None googall_tracker: str | None = None @app.get("/items/") async def read_items(cookies: Annotated[Cookies, Cookie()]):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 383 bytes - Viewed (0) -
docs_src/path_params_numeric_validations/tutorial002_an.py
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 321 bytes - Viewed (0) -
docs/de/docs/advanced/testing-dependencies.md
Für diese Fälle verfügt Ihre **FastAPI**-Anwendung über das Attribut `app.dependency_overrides`, bei diesem handelt sich um ein einfaches `dict`. Um eine Abhängigkeit für das Testen zu überschreiben, geben Sie als Schlüssel die ursprüngliche Abhängigkeit (eine Funktion) und als Wert Ihre Überschreibung der Abhängigkeit (eine andere Funktion) ein. Und dann ruft **FastAPI** diese Überschreibung anstelle der ursprünglichen Abhängigkeit auf.
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.5K bytes - Viewed (0) -
docs/zh/docs/advanced/testing-dependencies.md
此时,最好覆盖调用外部验证应用的依赖项,使用返回模拟测试用户的自定义依赖项就可以了。 ### 使用 `app.dependency_overrides` 属性 对于这些用例,**FastAPI** 应用支持 `app.dependency_overrides` 属性,该属性就是**字典**。 要在测试时覆盖原有依赖项,这个字典的键应当是原依赖项(函数),值是覆盖依赖项(另一个函数)。 这样一来,**FastAPI** 就会调用覆盖依赖项,不再调用原依赖项。 ```Python hl_lines="26-27 30" {!../../docs_src/dependency_testing/tutorial001.py!} ``` /// tip | "提示" **FastAPI** 应用中的任何位置都可以实现覆盖依赖项。 原依赖项可用于*路径操作函数*、*路径操作装饰器*(不需要返回值时)、`.include_router()` 调用等。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 1.9K bytes - Viewed (0) -
docs/pt/docs/advanced/testing-dependencies.md
### Utilize o atributo `app.dependency_overrides` Para estes casos, a sua aplicação **FastAPI** possui o atributo `app.dependency_overrides`. Ele é um simples `dict`. Para sobrepor a dependência para os testes, você coloca como chave a dependência original (a função), e como valor, a sua sobreposição da dependência (outra função). E então o **FastAPI** chamará a sobreposição no lugar da dependência original. //// tab | Python 3.10+
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 3.2K bytes - Viewed (0) -
docs_src/cookie_param_models/tutorial002_pv1.py
from typing import Union from fastapi import Cookie, FastAPI from pydantic import BaseModel app = FastAPI() class Cookies(BaseModel): class Config: extra = "forbid" session_id: str fatebook_tracker: Union[str, None] = None googall_tracker: Union[str, None] = None @app.get("/items/") async def read_items(cookies: Cookies = Cookie()):
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Sep 17 18:54:10 UTC 2024 - 385 bytes - Viewed (0) -
docs_src/settings/app02_an/main.py
from functools import lru_cache from fastapi import Depends, FastAPI from typing_extensions import Annotated from .config import Settings app = FastAPI() @lru_cache def get_settings(): return Settings() @app.get("/info") async def info(settings: Annotated[Settings, Depends(get_settings)]): return { "app_name": settings.app_name, "admin_email": settings.admin_email,
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Tue Oct 24 20:26:06 UTC 2023 - 456 bytes - Viewed (0) -
docs/zh-hant/docs/learn/index.md
# 學習 以下是學習 FastAPI 的入門介紹和教學。
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Feb 16 12:06:22 UTC 2024 - 186 bytes - Viewed (0)