iPhone POSTing to Django and gets CSRF verification failed

前端 未结 2 1759
青春惊慌失措
青春惊慌失措 2021-02-11 01:15

I send a POST request from IPhone to Django and get \"CSRF verification failed\", which I can\'t perfectly understand. I tried to find a good solution over the internet, but I c

2条回答
  •  伪装坚强ぢ
    2021-02-11 01:44

    Am I wrong or it just don't make sense to use this on native app?

    In that case, you could just disable this protection using this decorator:

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

提交回复
热议问题