Repository navigation
Use the request-first TemplateResponse signature for the main UI page - #183
Open
mayuriphad wants to merge 1 commit into
Open
mayuriphad wants to merge 1 commit into
mayuriphad wants to merge 1 commit into
Conversation
Signed-off-by: mayuriphad <mayuriphad656@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main UI route calls
templates.TemplateResponse("index.html", {"request": request}). That legacy signature was deprecated in Starlette 0.29 and removed in 1.0, so on an environment with a current Starlette (for example the unpinnedrequirements-strixhalo.txt, or a manually upgraded venv)/fails to render:and the user gets the "Internal Server Error" fallback page. The call is now
templates.TemplateResponse(request, "index.html"), which Starlette (0.29+, including 1.x) accepts and which still injectsrequestinto the template context. Thefastapi<0.116pins in the other requirements files already resolve to a Starlette that supports it.Fixes #179
Checked with Starlette 1.7.0: the old call raises
TypeError: unhashable type: 'dict', the new call returns 200.