title: How to delete a django JWT token?
body: <p>I am using the Django rest framework JSON Web token API that is found here on github (<a href="https://github.com/GetBlimp/django-rest-framework-jwt/tree/master/" rel="noreferrer">https://github.com/GetBlimp/django-rest-framework-jwt/tree/master/</a>).</p>
  
  <p>I can successfully create tokens and use them to call protected REST APis. However, there are certain cases where I would like to delete a specific token before its expiry time. So I thought to do this with a view like:</p>
  
  <pre><code>class Logout(APIView):
      permission_classes = (IsAuthenticated, )
      authentication_classes = (JSONWebTokenAuthentication, )
  
      def post(self, request):
          # simply delete the token to force a login        
          request.auth.delete()  # This will not work
          return Response(status=status.HTTP_200_OK)
  </code></pre>
  
  <p>The <code>request.auth</code> is simply a string object. So, this is of course, not going to work but I was not sure how I can clear the underlying token.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Reading more about this, it seems that I do not need to do anything as nothing is ever stored on the server side with JWT. So just closing the application and regenerating the token on the next login is enough. Is that correct?</p>