loading...

403 forbidden error Django restful request.

suryanarayana profile image SURYA NARAYANA MURTHY Updated on ・1 min read

Add the below statement on top of each and every view function definition (views.py).

@api_view(["POST", "GET"])

eg:

@api_view(["POST", "GET"])
def GivenInput():
   return Response(e.args[0],status.HTTP_400_BAD_REQUEST)

Note*: I don't know any alternative way to make it global throughout the file.

Discussion

markdown guide