티스토리 뷰
장고 render 와 redirect 차이
- 단어 그대로 render 는 템플릿을 render 해주는 것이다. render 해줄때 context를 통해 데이터를 템플릿에 넘길 수 있다.
- 단어 그대로 redirect는 템플릿으로 redirect 해주는 것이다. url 로 이동한다고 볼 수 있다.
render()
render(request, template_name, context=None, content_type=None, status=None, using=None)
Combines a given template with a given context dictionary and returns an HttpResponse object with that rendered text.
Django does not provide a shortcut function which returns a TemplateResponse because the constructor of TemplateResponse offers the same level of convenience as render().
redirect()
redirect(to, *args, permanent=False, **kwargs)
Returns an HttpResponseRedirect to the appropriate URL for the arguments passed.
출처:
Django documentation - shortcut functions
오늘 한 일
- 딥러닝 강의 수강
'What I Learned' 카테고리의 다른 글
TIL_20221123_장고 로그인 예외처리 (0) | 2022.11.24 |
---|---|
TIL_20221122_인증 & 인가 (0) | 2022.11.23 |
WIL_221114to221118_내일배움캠프12주차 (0) | 2022.11.20 |
TIL_20221118_도커 사용 트러블 슈팅 (0) | 2022.11.20 |
TIL_20221117_도커 이미지, 컨테이너 (0) | 2022.11.17 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 스파르타코딩클럽
- 자료구조
- 코드컨벤션
- 파이썬나누기
- css
- HTTP
- 항해솔직후기
- css선택자
- Til
- 컴퓨터구조
- github
- 항해플러스후기
- 파이썬
- 스파르타내일배움캠프
- wil
- GIT
- 함수
- 파이썬 함수 return
- HTML
- dtl
- 장고
- 클래스
- API
- 항해플러스ai
- 반복문
- 예외처리
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함