title: Getting 403 Forbidden error in django applicaion if user is logged-in in my website. I am not getting this error for anonymous user
body: <p>I am new to django and ajax both.
  I am getting 403 error only if I am logged-in user. If am logged out same is working fine.
  Here is my ajax call:</p>
  <pre><code>$(&quot;div#mainCont&quot;).on(&quot;click&quot;,&quot;#detail_icon&quot;, function(){
     var _tickName = $(this).parent().attr('id');
     var csrf = $(&quot;input[name=csrfmiddlewaretoken]&quot;).val();
     
     $.ajax({
         method: &quot;POST&quot;,
         url: 'performance',
         data:JSON.stringify({
             csrfmiddlewaretoken: csrf,
             ticker: _tickName
    
         }),
         success: function (data) {
          console.log(data)
         }
  });
  </code></pre>
  <p>This is my view:</p>
  <pre class="lang-py prettyprint-override"><code>class PerformanceView(APIView):
      def get(self,request, format=None):
          queryset = Advice.objects.all()
          serializer = AdviceSerializers(queryset,many=True)
          return Response(serializer.data)   
  
      def post(self, request):
          data=json.loads(request.body)
          print(data)
          queryset = Stocks.objects.filter(ticker=data[&quot;ticker&quot;])
          serializer = PerformanceSerializers(queryset,many=True)
          return Response(serializer.data)
  </code></pre>
  <p>Thanks in advance</p>