在views.py中
from django.views.generic.base import Viewclass ueditor(View):@csrf_exemptdef post(self, request):print(request.POST.get('abc', ""))return render(request, "ueditor.html")
这样写是csrf_exempt是不会生效的
只有继承了django rest framework的apiview有才用:
from rest_framework.views import APIViewclass ueditor(APIView):@csrf_exemptdef post(self, request):print(request.POST.get('abc', ""))return render(request, "ueditor.html")