Skip to content

fix: use request-first TemplateResponse signature on index route - #5

Open
SAY-5 wants to merge 1 commit into
abhishekkrthakur:mainfrom
SAY-5:fix-templateresponse-signature
Open

fix: use request-first TemplateResponse signature on index route#5
SAY-5 wants to merge 1 commit into
abhishekkrthakur:mainfrom
SAY-5:fix-templateresponse-signature

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 26, 2026

Copy link
Copy Markdown

The index route calls templates.TemplateResponse("index.html", {"request": request}), which uses Starlette's legacy argument order. That form has been deprecated for a while and now raises TypeError: unhashable type: 'dict' on Starlette 1.0, since the template name ends up being the context dict. That is the 500 seen in #4 when opening the page.

Switched to the request-first form Starlette recommends, TemplateResponse(request, "index.html"), and added a small regression test that fails if the deprecated order comes back. Full test suite and black/isort/flake8 stay green.

Fixes #4

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: unhashable type: 'dict'

1 participant