views.py中:
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def post_method(request):
pass
去跳過(guò) csrf 中間件的保護(hù),html中就不用加csrf相關(guān)的東西了
views.py中:
from django.views.decorators.csrf import csrf_exempt
@csrf_exempt
def post_method(request):
pass
去跳過(guò) csrf 中間件的保護(hù),html中就不用加csrf相關(guān)的東西了