Views 1686 Votes 0 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

Python Django, view의 response 에서 cookie 세팅

template의 request에서 cookie 읽기


In your views:

def process_response(self, request, response):
response.set_cookie('changed', 'yes')
response.set_cookie('choose', request.LANGUAGE_CODE)
return response

And in your template:

{{ request.COOKIES.cookie_name }}


And using if-statements in your template:

{% if request.COOKIES.cookie_name == 'name' %}


?

List of Articles
No. Category Subject Author Date Views
9 Algorithm OCB5 Injection 앗싸뵹! ㅋㅋ file hooni 2014.07.01 796
8 Algorithm 스터디 자료, 암호화에 대해서.. 나중에 볼 ppt.. file hooni 2013.04.23 13370
7 Algorithm [algorithm] Greedy (탐욕 기법) hooni 2003.04.23 15108
6 Algorithm [security] RSA 암호화 설명과 예.. hooni 2013.04.23 16616
5 Algorithm [security] 블럭 암호에 대해서.. hooni 2013.04.23 17118
4 Algorithm 암호 알고리즘 및 프로토콜의 이해.. file hooni 2013.04.23 17208
3 Algorithm Polynomial time 이란? ㅋㅋ hooni 2013.04.23 22679
2 Algorithm 러시아 페인트공 알고리즘에 대해.. hooni 2013.04.23 22895
1 Algorithm 디피헬만(Diffie-Hellman) 초간단 개념.. hooni 2013.04.23 81019
Board Pagination Prev 1 Next
/ 1