- Sort Score
- Result 10 results
- Languages All
Results 51 - 60 of 63 for cdef (0.26 sec)
-
docs_src/additional_responses/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Aug 26 13:32:30 GMT 2022 - 506 bytes - Viewed (0) -
docs_src/additional_status_codes/tutorial001.py
from fastapi.responses import JSONResponse app = FastAPI() items = {"foo": {"name": "Fighters", "size": 6}, "bar": {"name": "Tenders", "size": 3}} @app.put("/items/{item_id}") async def upsert_item( item_id: str, name: Union[str, None] = Body(default=None), size: Union[int, None] = Body(default=None), ): if item_id in items: item = items[item_id] item["name"] = name
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 684 bytes - Viewed (0) -
docs_src/metadata/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 805 bytes - Viewed (0) -
docs_src/extra_models/tutorial001.py
class UserInDB(BaseModel): username: str hashed_password: str email: EmailStr full_name: Union[str, None] = None def fake_password_hasher(raw_password: str): return "supersecret" + raw_password def fake_save_user(user_in: UserIn): hashed_password = fake_password_hasher(user_in.password) user_in_db = UserInDB(**user_in.dict(), hashed_password=hashed_password)
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 943 bytes - Viewed (0) -
docs_src/nosql_databases/tutorial001.py
hashed_password: str def get_user(bucket: Bucket, username: str): doc_id = f"userprofile::{username}" result = bucket.get(doc_id, quiet=True) if not result.value: return None user = UserInDB(**result.value) return user # FastAPI specific code app = FastAPI() @app.get("/users/{username}", response_model=User) def read_user(username: str): bucket = get_bucket()
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 1.3K bytes - Viewed (0) -
docs_src/sub_applications/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jun 11 21:53:19 GMT 2020 - 274 bytes - Viewed (0) -
docs_src/background_tasks/tutorial001.py
from fastapi import BackgroundTasks, FastAPI app = FastAPI() def write_notification(email: str, message=""): with open("log.txt", mode="w") as email_file: content = f"notification for {email}: {message}" email_file.write(content) @app.post("/send-notification/{email}") async def send_notification(email: str, background_tasks: BackgroundTasks):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 519 bytes - Viewed (0) -
docs_src/path_params/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 138 bytes - Viewed (0) -
docs_src/security/tutorial001.py
from fastapi import Depends, FastAPI from fastapi.security import OAuth2PasswordBearer app = FastAPI() oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token") @app.get("/items/") async def read_items(token: str = Depends(oauth2_scheme)):
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Jul 10 17:28:18 GMT 2020 - 269 bytes - Viewed (0) -
docs_src/body/tutorial001.py
Python - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat May 14 11:59:59 GMT 2022 - 309 bytes - Viewed (0)