Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starlette 버전업에 따른 템플릿 함수파라미터 변경사항 #249

Closed
kitrio opened this issue Jan 15, 2024 · 0 comments
Closed

Comments

@kitrio
Copy link
Contributor

kitrio commented Jan 15, 2024

배경

fastapi 108.0 에서 starlette 버전이 0.29로 업데이트되었습니다.

starlette issue Version 1.0.0
encode/starlette#2191
https://github.com/tiangolo/fastapi/releases

이슈 내용

이전 -> TemplateResponse('index.html', {'request': request})

이후 -> TemplateResponse(request, 'index.html')

템플릿함수에서 context 에 request 가 빠지고 첫번째 인수로 변경됩니다.
구버전 파라미터는 starlette 1.0에서 삭제됩니다.

https://fastapi.tiangolo.com/advanced/templates/?h=template
Fastapi 문서에는 108 버전 부터 바뀐 부분에 대해 서술되어있습니다.

이슈사항

requirements.txt 의 fastapi 버전표기를 고정 또는

UserTemplate, AdminTemplate, 경고창의 TemplateResponse 변경 필요

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

No branches or pull requests

2 participants