Contents

조회 수 1684 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

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
번호 분류 제목 글쓴이 날짜 조회 수
45 System/OS [linux] ProFTPD 타임아웃 설정 hooni 2003.04.23 12851
44 System/OS [unix] SUN Solaris 싱글모드.. ㅡ,.ㅡ; hooni 2003.04.23 11991
43 System/OS [bios] 시스템 부팅 도중 발생하는 비프음 hooni 2003.04.23 18158
42 System/OS [windows] 패스워드를 잊어먹었을때.. hooni 2003.04.23 17294
41 Database [mysql] DB->Text, Text->DB 변환 hooni 2003.04.23 12129
40 System/OS HTTP 프로토콜 (브라우저와 웹서버 간의 통신) hooni 2003.04.23 48250
39 System/OS [linux] 센드메일 동적릴레이 설치 hooni 2003.04.23 15228
38 System/OS [linux] 데스크탑환경(GNOME/KDE) 바꾸기.. hooni 2003.04.23 12101
37 System/OS [linux] 웹로그분석기(webalizer) 설치 & 팁 hooni 2003.04.23 14882
36 System/OS [linux] 메일서버 세팅정보(sendmail) hooni 2003.04.23 17407
35 System/OS [linux] APM(apache, php, mysql) + gd 설치순서.. hooni 2003.04.23 18851
34 System/OS [linux] 쉘 환경변수 PS1(프롬프트) hooni 2003.04.23 13492
Board Pagination Prev 1 ... 89 90 91 92 93 94 95 96 97 98 Next
/ 98