- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 421 for depende (0.06 sec)
-
docs_src/security/tutorial004_an_py310.py
async def get_current_active_user( current_user: Annotated[User, Depends(get_current_user)], ): if current_user.disabled: raise HTTPException(status_code=400, detail="Inactive user") return current_user @app.post("/token") async def login_for_access_token( form_data: Annotated[OAuth2PasswordRequestForm, Depends()], ) -> Token:
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Mon May 20 17:37:28 UTC 2024 - 4.1K bytes - Viewed (0) -
docs/en/docs/virtual-environments.md
At some point, you will probably end up writing many different programs that depend on **different packages**. And some of these projects you work on will depend on **different versions** of the same package. π± For example, you could create a project called `philosophers-stone`, this program depends on another package called **`harry`, using the version `1`**. So, you need to install `harry`. ```mermaid
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Sat Aug 24 03:16:23 UTC 2024 - 21.7K bytes - Viewed (0) -
tests/test_repeated_dependency_schema.py
from fastapi import Depends, FastAPI, Header, status from fastapi.testclient import TestClient app = FastAPI() def get_header(*, someheader: str = Header()): return someheader def get_something_else(*, someheader: str = Depends(get_header)): return f"{someheader}123" @app.get("/") def get_deps(dep1: str = Depends(get_header), dep2: str = Depends(get_something_else)): return {"dep1": dep1, "dep2": dep2}
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.2K bytes - Viewed (0) -
docs_src/dependencies/tutorial008_an_py39.py
from fastapi import Depends async def dependency_a(): dep_a = generate_dep_a() try: yield dep_a finally: dep_a.close() async def dependency_b(dep_a: Annotated[DepA, Depends(dependency_a)]): dep_b = generate_dep_b() try: yield dep_b finally: dep_b.close(dep_a) async def dependency_c(dep_b: Annotated[DepB, Depends(dependency_b)]):
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 521 bytes - Viewed (0) -
docs_src/bigger_applications/app_an_py39/main.py
from fastapi import Depends, FastAPI from .dependencies import get_query_token, get_token_header from .internal import admin from .routers import items, users app = FastAPI(dependencies=[Depends(get_query_token)]) app.include_router(users.router) app.include_router(items.router) app.include_router( admin.router, prefix="/admin", tags=["admin"], dependencies=[Depends(get_token_header)],
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 552 bytes - Viewed (0) -
docs_src/dependencies/tutorial005_an_py39.py
from typing import Annotated, Union from fastapi import Cookie, Depends, FastAPI app = FastAPI() def query_extractor(q: Union[str, None] = None): return q def query_or_cookie_extractor( q: Annotated[str, Depends(query_extractor)], last_query: Annotated[Union[str, None], Cookie()] = None, ): if not q: return last_query return q @app.get("/items/") async def read_query(
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Tue Mar 26 16:56:53 UTC 2024 - 529 bytes - Viewed (0) -
docs_src/bigger_applications/app_an/main.py
from fastapi import Depends, FastAPI from .dependencies import get_query_token, get_token_header from .internal import admin from .routers import items, users app = FastAPI(dependencies=[Depends(get_query_token)]) app.include_router(users.router) app.include_router(items.router) app.include_router( admin.router, prefix="/admin", tags=["admin"], dependencies=[Depends(get_token_header)],
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 552 bytes - Viewed (0) -
docs/en/docs/reference/dependencies.md
# Dependencies - `Depends()` and `Security()` ## `Depends()` Dependencies are handled mainly with the special function `Depends()` that takes a callable. Here is the reference for it and its parameters. You can import it directly from `fastapi`: ```python from fastapi import Depends ``` ::: fastapi.Depends ## `Security()`
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:53:19 UTC 2024 - 671 bytes - Viewed (0) -
docs/ko/docs/tutorial/dependencies/classes-as-dependencies.md
**FastAPI**λ `CommonQueryParams` ν΄λμ€λ₯Ό νΈμΆν©λλ€. μ΄κ²μ ν΄λΉ ν΄λμ€μ "μΈμ€ν΄μ€"λ₯Ό μμ±νκ³ κ·Έ μΈμ€ν΄μ€λ ν¨μμ 맀κ°λ³μ `commons`λ‘ μ λ¬λ©λλ€. ## νμ νν vs `Depends` μ μ½λμμ `CommonQueryParams`λ₯Ό λ λ² μμ±ν λ°©μμ μ£Όλͺ©νμμμ€: ```Python commons: CommonQueryParams = Depends(CommonQueryParams) ``` λ§μ§λ§ `CommonQueryParams` λ³μλ₯Ό 보면: ```Python ... = Depends(CommonQueryParams) ``` ... **FastAPI**κ° μ€μ λ‘ μ΄λ€ κ²μ΄ μμ‘΄μ±μΈμ§ μκΈ° μν΄μ μ¬μ©νλ λ°©λ²μ λλ€.
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 7.9K bytes - Viewed (0) -
docs_src/security/tutorial002_py310.py
) async def get_current_user(token: str = Depends(oauth2_scheme)): user = fake_decode_token(token) return user @app.get("/users/me") async def read_users_me(current_user: User = Depends(get_current_user)):
Registered: Sun Oct 27 07:19:11 UTC 2024 - Last Modified: Fri Jan 07 14:11:31 UTC 2022 - 711 bytes - Viewed (0)