내용으로 건너뛰기
GaramX
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
현재 위치:
home
»
python
»
django
»
csrf
추적:
•
csrf
python:django:csrf
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== CSRF protection ====== CSRF를 이용하여 시스템을 보호하는 것이 완전하지는 않지만 해주어야 하는군요. <code html> <form method="post"> {% csrf_token %} <input type="text" name="username"> <button type="submit">Submit</button> </form> </code> <code> function getCookie(name) { let cookieValue = null; if (document.cookie && document.cookie !== '') { const cookies = document.cookie.split(';'); for (let i = 0; i < cookies.length; i++) { const cookie = cookies[i].trim(); // Does this cookie string begin with the name we want? if (cookie.substring(0, name.length + 1) === (name + '=')) { cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); break; } } } return cookieValue; } const csrftoken = getCookie('csrftoken'); </code>
python/django/csrf.txt
· 마지막으로 수정됨: 2025/08/14 12:53 저자
taekgu
문서 도구
문서 보기
이전 판
역링크
맨 위로