Develop
2019.12.06 10:33
[python][django] request.cookie 읽어오기 ㅋㅋㅋ (쓰기)
조회 수 1671 댓글 0
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' %}
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
9 | Algorithm | OCB5 Injection 앗싸뵹! ㅋㅋ | hooni | 2014.07.01 | 781 |
8 | Algorithm | 러시아 페인트공 알고리즘에 대해.. | hooni | 2013.04.23 | 22881 |
7 | Algorithm | 디피헬만(Diffie-Hellman) 초간단 개념.. | hooni | 2013.04.23 | 81004 |
6 | Algorithm | 암호 알고리즘 및 프로토콜의 이해.. | hooni | 2013.04.23 | 17194 |
5 | Algorithm | Polynomial time 이란? ㅋㅋ | hooni | 2013.04.23 | 22248 |
4 | Algorithm | [security] 블럭 암호에 대해서.. | hooni | 2013.04.23 | 17104 |
3 | Algorithm | 스터디 자료, 암호화에 대해서.. 나중에 볼 ppt.. | hooni | 2013.04.23 | 13356 |
2 | Algorithm | [security] RSA 암호화 설명과 예.. | hooni | 2013.04.23 | 16602 |
1 | Algorithm | [algorithm] Greedy (탐욕 기법) | hooni | 2003.04.23 | 15096 |