If anyone is facing the same problem, here is the solution. The problem is 
that function view is missing the @api_view() decorator, this fixes the 
problem:

from django.views.decorators.csrf import csrf_exempt
from rest_framework.exceptions import ParseError
from rest_framework.decorators import api_view

# Create your views here.
@csrf_exempt
@api_view()
def test_view(request):
        raise ParseError("test!", 409)

It would have been great if the documentation be more detailed about it.

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/115513ff-cb27-4ae4-8778-641e79b8be15%40googlegroups.com.

Reply via email to