- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 55 for apps (0.16 sec)
-
docs_src/extending_openapi/tutorial001.py
from fastapi import FastAPI from fastapi.openapi.utils import get_openapi app = FastAPI() @app.get("/items/") async def read_items(): return [{"name": "Foo"}] def custom_openapi(): if app.openapi_schema: return app.openapi_schema openapi_schema = get_openapi( title="Custom title", version="2.5.0", summary="This is a very custom OpenAPI schema",
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri Jun 30 18:25:16 GMT 2023 - 737 bytes - Viewed (0) -
docs_src/wsgi/tutorial001.py
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Tue May 09 14:32:00 GMT 2023 - 443 bytes - Viewed (0) -
docs_src/async_sql_databases/tutorial001.py
completed: bool app = FastAPI() @app.on_event("startup") async def startup(): await database.connect() @app.on_event("shutdown") async def shutdown(): await database.disconnect() @app.get("/notes/", response_model=List[Note]) async def read_notes(): query = notes.select() return await database.fetch_all(query) @app.post("/notes/", response_model=Note)
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 1.4K bytes - Viewed (0) -
docs_src/advanced_middleware/tutorial001.py
from fastapi import FastAPI from fastapi.middleware.httpsredirect import HTTPSRedirectMiddleware app = FastAPI() app.add_middleware(HTTPSRedirectMiddleware) @app.get("/") async def main():
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 231 bytes - Viewed (0) -
docs_src/cors/tutorial001.py
from fastapi.middleware.cors import CORSMiddleware app = FastAPI() origins = [ "http://localhost.tiangolo.com", "https://localhost.tiangolo.com", "http://localhost", "http://localhost:8080", ] app.add_middleware( CORSMiddleware, allow_origins=origins, allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) @app.get("/") async def main():
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 459 bytes - Viewed (0) -
docs_src/response_model/tutorial001.py
from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: Union[str, None] = None price: float tax: Union[float, None] = None tags: List[str] = [] @app.post("/items/", response_model=Item) async def create_item(item: Item) -> Any: return item @app.get("/items/", response_model=List[Item]) async def read_items() -> Any:
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sat Jan 07 13:45:48 GMT 2023 - 562 bytes - Viewed (0) -
docs_src/custom_request_and_route/tutorial001.py
request = GzipRequest(request.scope, request.receive) return await original_route_handler(request) return custom_route_handler app = FastAPI() app.router.route_class = GzipRoute @app.post("/sum") async def sum_numbers(numbers: List[int] = Body()):
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 973 bytes - Viewed (0) -
docs_src/websockets/tutorial001.py
input.value = '' event.preventDefault() } </script> </body> </html> """ @app.get("/") async def get(): return HTMLResponse(html) @app.websocket("/ws") async def websocket_endpoint(websocket: WebSocket): await websocket.accept() while True: data = await websocket.receive_text()
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Thu Mar 26 19:09:53 GMT 2020 - 1.4K bytes - Viewed (0) -
docs_src/request_forms_and_files/tutorial001.py
from fastapi import FastAPI, File, Form, UploadFile app = FastAPI() @app.post("/files/") async def create_file( file: bytes = File(), fileb: UploadFile = File(), token: str = Form() ): return { "file_size": len(file), "token": token, "fileb_content_type": fileb.content_type,
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Fri May 13 23:38:22 GMT 2022 - 317 bytes - Viewed (0) -
docs_src/graphql/tutorial001.py
Python - Registered: Sun Apr 21 07:19:11 GMT 2024 - Last Modified: Sun Oct 03 18:00:28 GMT 2021 - 446 bytes - Viewed (0)