标签:code ace rip line add script ble ret asc
方式一
1
2
3
|
$.ajaxSetup({ data: {csrfmiddlewaretoken: ‘{{ csrf_token }}‘ }, }); |
方式二
1
2
3
4
5
|
<form> {% csrf_token %} </form><br><br><br>$.ajax({<br>...<br>data:{ "csrfmiddlewaretoken" :$( "[name=‘csrfmiddlewaretoken‘]" ).val(); }<br>}) |
方式三
1
|
<script src= "{% static ‘js/jquery.cookie.js‘ %}" ></script> |
1
2
3
4
5
|
$.ajax({ headers:{ "X-CSRFToken" :$.cookie( ‘csrftoken‘ )}, }) |
标签:code ace rip line add script ble ret asc
原文地址:https://www.cnblogs.com/hanbowen/p/9567441.html