views.py 492 B

12345678910111213
  1. from rest_framework.response import Response
  2. from rest_framework import status
  3. from rest_framework.decorators import api_view, permission_classes, authentication_classes
  4. from rest_framework.permissions import IsAuthenticated
  5. from drf_temptoken.auth import TempTokenAuthentication
  6. @api_view(http_method_names=('GET',))
  7. @permission_classes((IsAuthenticated,))
  8. @authentication_classes((TempTokenAuthentication,))
  9. def check_auth(request):
  10. return Response(status=status.HTTP_204_NO_CONTENT)