Skip to content

added keywords arguments for self.templates.TemplateResponse#1091

Closed
haykeminyan wants to merge 2 commits into
smithyhq:mainfrom
haykeminyan:fix/haykeminyan/template-responses-keyword-arguments
Closed

added keywords arguments for self.templates.TemplateResponse#1091
haykeminyan wants to merge 2 commits into
smithyhq:mainfrom
haykeminyan:fix/haykeminyan/template-responses-keyword-arguments

Conversation

@haykeminyan

Copy link
Copy Markdown

Update here https://fastapi.tiangolo.com/advanced/templates/ now templateResponse demands use

this structure

templates.TemplateResponse(
        request=request, name="item.html", context={"id": id}
    )

previously was

templates.TemplateResponse(
       request, "item.html",{"id": id}
    )

@mmzeynalli

Copy link
Copy Markdown
Member

Nice detail! If possible, do fix lint errors as well

@haykeminyan

Copy link
Copy Markdown
Author

Nice detail! If possible, do fix lint errors as well

Thanks! added linter fixes with .pre-commit-config.yaml

@mmzeynalli mmzeynalli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is minor issue. TemplateResponse we have in the code is not Starlette/FastAPI’s, but our own, in templating.py file. So, I believe, you only need update it there, and no need to touch anywhere else.

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.

2 participants