Contents

조회 수 1669 댓글 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' %}



?

  1. [ubuntu] 우분투 18.04에 PHP5 설치하기

  2. [js] Text 값을 클립보드에 복사하기

  3. [sh] 쉘스크립트 if 비교 연산

  4. [sh] html 안에 있는 img 다운 받는 쉘 스크립트

  5. [ios] Start developing your navigation app for CarPlay without enrollment

  6. [php] 3 Ways to Detect Mobile or Desktop in PHP

  7. 자주 쓰는 Docker 명령어 alias

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

  9. [python] 파라미터 앞에 *, ** 의 의미? (*args, **kwargs)

  10. 링크들 보고 지울 내용

  11. [Javascript][Ajax] 자바스크립트 강의 산출물

  12. [ios] Locale Identifiers

Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 71 Next
/ 71