Contents

Views 1847 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' %}



?

  1. CentOS 에서 Cacti 설치하기

  2. [ios] Xcode cannot run using the selected device

  3. 인증서 *.p12 파일을 *.pem 파일로 변환

  4. [linux] CentOS 에 APM 설치하기

  5. [php] mysql_ 과 mysqli_ 의 차이

  6. [python][django] request.cookie 읽어오기 ㅋㅋㅋ (쓰기)

  7. Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

  8. [ios] Pod 특정 버전 설치하고 사용하기

  9. [svn] 하나의 SVN에서 멀티 저장소 (One svnserve, multiple repositories)

  10. [c] 한글 문자열 출력

  11. [ios] @property의 속성 (strong, weak, copy) 사용 경우

  12. 네트워크 용어 정리

Board Pagination Prev 1 ... 76 77 78 79 80 81 82 83 84 85 ... 98 Next
/ 98