Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix TemplateResponse deprecation warning in Starlette#316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/fix-deprecation-warning-template-response

Conversation

Copy link
Contributor

CopilotAI commentedNov 23, 2025
edited
Loading

Starlette changed theTemplateResponse signature to requireRequest as the first parameter instead of the template name.

Changes:

  • Updatedapi/routes/auth.py home route to use new signature:TemplateResponse(request, name, context) instead ofTemplateResponse(name, {"request": request, ...context})
  • Removedrequest from context dict as it's now automatically injected
# Beforereturntemplates.TemplateResponse("chat.j2",    {"request":request,"is_authenticated":is_authenticated_flag, ...})# Afterreturntemplates.TemplateResponse(request,"chat.j2",    {"is_authenticated":is_authenticated_flag, ...})
Original prompt

This section details on the original issue you should resolve

<issue_title>templating.py:162: DeprecationWarning</issue_title>
<issue_description>```
/usr/local/lib/python3.12/site-packages/starlette/templating.py:162: DeprecationWarning: Thename is not the first parameter anymore. The first parameter should be the `Request` instance.
Replace `TemplateResponse(name, {"request": request})` by `TemplateResponse(request, name)`.

## Comments on the Issue (you are @copilot in this section)<comments></comments>

✨ Let Copilot coding agentset things up for you — coding agent works faster and does higher quality work when set up for your repo.

CopilotAI self-assigned thisNov 23, 2025
@coderabbitai
Copy link
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the@coderabbitai review command.

You can disable this status message by setting thereviews.review_status tofalse in the CodeRabbit configuration file.


Comment@coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com>
CopilotAI changed the title[WIP] Fix deprecation warning in templating.pyFix TemplateResponse deprecation warning in StarletteNov 23, 2025
CopilotAI requested a review fromgkorlandNovember 23, 2025 16:14
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gkorlandgkorlandAwaiting requested review from gkorland

At least 1 approving review is required to merge this pull request.

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

templating.py:162: DeprecationWarning

2 participants

@gkorland

[8]ページ先頭

©2009-2025 Movatter.jp