Last active
December 27, 2025 11:49
-
-
Save GeroZayas/24908e456f260320dd1ad7d47b0194af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from fastapi.templating import Jinja2Templates | |
| templates = Jinja2Templates(directory="templates") | |
| @app.get("/items/{id}", response_class=HTMLResponse) | |
| async def read_item(request: Request, id: str): | |
| return templates.TemplateResponse( | |
| request=request, name="item.html", context={"id": id} | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment