Contents

조회 수 1678 댓글 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. [swift] 실행시간 측정하기

  2. [swift] UIView에서 subview 찾기

  3. [swift] popToRoot 모달뷰, 네비게이션컨트롤러 한꺼번에 닫기

  4. [swift] NotificationCenter 간단 예제

  5. [spring] 스프링 IoC/DI

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

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

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

  9. [python] 파이썬 공부하는 사이트~

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

  11. [python] 애니팡, 캔디팡 매크로

  12. [python] DJI Tello 드론 코딩 (프로그래밍)

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