遇到“CSRF verification failed. Request aborted”问题的解决办法

解决

CSRF verification failed. Request aborted.
You are seeing this message because this site requires a CSRF cookie when submitting forms. This cookie is required for security reasons, to ensure that your browser is not being hijacked by third parties.
If you have configured your browser to disable cookies, please re-enable them, at least for this site, or for 'same-origin' requests.

的方法

在form表单中添加
{% csrf_token %}  

并设置

from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def func(request):

猜你喜欢

转载自blog.csdn.net/weixin_38052444/article/details/82668014