- Sort Score
- Result 10 results
- Languages All
Results 161 - 170 of 585 for Depends (0.05 sec)
-
tests/test_security_oauth2.py
@app.post("/login") # Here we use string annotations to test them def login(form_data: "OAuth2PasswordRequestFormStrict" = Depends()): return form_data @app.get("/users/me") # Here we use string annotations to test them def read_current_user(current_user: "User" = Depends(get_current_user)): return current_user client = TestClient(app) def test_security_oauth2():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 10.7K bytes - Viewed (0) -
tests/test_security_oauth2_optional_description.py
return None user = User(username=oauth_header) return user @app.post("/login") def login(form_data: OAuth2PasswordRequestFormStrict = Depends()): return form_data @app.get("/users/me") def read_users_me(current_user: Optional[User] = Depends(get_current_user)): if current_user is None: return {"msg": "Create an account first"} return current_user client = TestClient(app)
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Apr 18 19:40:57 UTC 2024 - 10.9K bytes - Viewed (0) -
docs_src/bigger_applications/app_an/routers/items.py
from fastapi import APIRouter, Depends, HTTPException from ..dependencies import get_token_header router = APIRouter( prefix="/items", tags=["items"], dependencies=[Depends(get_token_header)], responses={404: {"description": "Not found"}}, ) fake_items_db = {"plumbus": {"name": "Plumbus"}, "gun": {"name": "Portal Gun"}} @router.get("/") async def read_items(): return fake_items_db
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sat Mar 18 12:29:59 UTC 2023 - 1011 bytes - Viewed (0) -
docs/em/docs/advanced/advanced-dependencies.md
```Python hl_lines="16" {!../../docs_src/dependencies/tutorial011.py!} ``` & ๐ ๐ ๐ฅ ๐ช "๐" ๐ ๐, ๐ ๐ โ๏ธ `"bar"` ๐ โซ๏ธ, ๐ข `checker.fixed_content`. ## โ๏ธ ๐ ๐ โคด๏ธ, ๐ฅ ๐ช โ๏ธ ๐ `checker` `Depends(checker)`, โฉ๏ธ `Depends(FixedContentQueryChecker)`, โฉ๏ธ ๐ ๐, `checker`, ๐ซ ๐ โซ๏ธ. & ๐โ โ ๐, **FastAPI** ๐ ๐ค ๐ `checker` ๐: ```Python checker(q="somequery") ```
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 06 20:36:54 UTC 2024 - 2K bytes - Viewed (0) -
docs_src/sql_databases/tutorial002_an_py310.py
from typing import Annotated from fastapi import Depends, FastAPI, HTTPException, Query from sqlmodel import Field, Session, SQLModel, create_engine, select class HeroBase(SQLModel): name: str = Field(index=True) age: int | None = Field(default=None, index=True) class Hero(HeroBase, table=True): id: int | None = Field(default=None, primary_key=True) secret_name: str class HeroPublic(HeroBase): id: int
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 2.5K bytes - Viewed (0) -
docs_src/sql_databases/tutorial001_an_py310.py
from typing import Annotated from fastapi import Depends, FastAPI, HTTPException, Query from sqlmodel import Field, Session, SQLModel, create_engine, select class Hero(SQLModel, table=True): id: int | None = Field(default=None, primary_key=True) name: str = Field(index=True) age: int | None = Field(default=None, index=True) secret_name: str sqlite_file_name = "database.db" sqlite_url = f"sqlite:///{sqlite_file_name}"
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Wed Oct 09 19:44:42 UTC 2024 - 1.7K bytes - Viewed (0) -
compat/maven-compat/src/test/java/org/apache/maven/project/inheritance/t09/ProjectInheritanceTest.java
* * 1. dependencyManagement lists dependencies on a & b, * with an exclusion on c in b. * 2. the child project lists a dependency on project a only * 3. a depends on b (which is transitive to the child project), * and b depends on c. * * We should see that the resulting size of collected artifacts is two: * a & b only. */ @Test
Registered: Sun Nov 03 03:35:11 UTC 2024 - Last Modified: Fri Oct 25 12:31:46 UTC 2024 - 5K bytes - Viewed (0) -
fastapi/__init__.py
from .exceptions import WebSocketException as WebSocketException from .param_functions import Body as Body from .param_functions import Cookie as Cookie from .param_functions import Depends as Depends from .param_functions import File as File from .param_functions import Form as Form from .param_functions import Header as Header from .param_functions import Path as Path from .param_functions import Query as Query
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Sun Oct 27 21:51:55 UTC 2024 - 1.1K bytes - Viewed (0) -
tests/test_security_api_key_query_description.py
from fastapi import Depends, FastAPI, Security from fastapi.security import APIKeyQuery from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() api_key = APIKeyQuery(name="key", description="API Key Query") class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(api_key)): user = User(username=oauth_header) return user @app.get("/users/me")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2K bytes - Viewed (0) -
tests/test_security_api_key_query.py
from fastapi import Depends, FastAPI, Security from fastapi.security import APIKeyQuery from fastapi.testclient import TestClient from pydantic import BaseModel app = FastAPI() api_key = APIKeyQuery(name="key") class User(BaseModel): username: str def get_current_user(oauth_header: str = Security(api_key)): user = User(username=oauth_header) return user @app.get("/users/me")
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 1.8K bytes - Viewed (0)