1

I have added @permission_classes((IsAuthenticatedOrReadOnly,)) annotation on my view n on calling post without auth details it is allowing to post data?

@permission_classes((IsAuthenticatedOrReadOnly,))
@api_view(['GET','POST'])
def my_view(request):
    # code for post and get
Cœur
  • 37,241
  • 25
  • 195
  • 267
drs
  • 23
  • 3

1 Answers1

1

You missed this:

@authentication_classes(...)
Celeo
  • 5,583
  • 8
  • 39
  • 41
chandu
  • 1,053
  • 9
  • 18