title: Django Rest Framework Token Authentication with Postman
body: <p>I am trying to use <strong>Postman</strong> to test my DRF end-point, but I always get an <code>Authentication credentials were not provided.</code> error. The end-point works properly, but I haven't found how to send the request from <strong>Postman</strong>.</p>
  
  <p>I am able to get the token for the user:</p>
  
  <p><a href="https://i.stack.imgur.com/Ea2ZC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ea2ZC.png" alt="enter image description here"></a></p>
  
  <p>But I always get the error when I try to use the token to send a request:</p>
  
  <p><a href="https://i.stack.imgur.com/Q3Wfa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q3Wfa.png" alt="enter image description here"></a></p>
  
  <p>I set the <strong>Authorization Type</strong> to <code>Inherit auth from parent</code>.</p>
  
  <p>This is the code for the view:</p>
  
  <pre><code>class AlbumViewSet(viewsets.ModelViewSet):
      permission_classes = (permissions.IsAuthenticated,)
      queryset = proxies.AlbumProxy.objects.all()
      serializer_class = serializers.AlbumSerializer
      filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter,)
      search_fields = ('name', 'description', 'company__name')
      filter_fields = ('code', 'company')
  
      def get_permissions(self):
          if self.action == 'retrieve':
              return []
  
          return super(AlbumViewSet, self).get_permissions()
  
      def retrieve(self, request, pk):
          password = request.query_params.get('password', None)
  
          try:
              instance = proxies.AlbumProxy.objects.get(pk=pk)
          except:
              return Response({'success': False, 'code': 1})
  
          if instance.access_code != password and password != settings.MASTER_KEY:
              return Response({'success': False, 'code': 2})
  
          instance_to_return = serializers.AlbumSerializer(instance=instance, context={'request': request}).data
          instance_to_return.pop('access_code')
          instance_to_return['success'] = True
  
          return Response(instance_to_return)
  </code></pre>
  
  <p>This is my <code>REST_FRAMEWORK</code> constant from <code>settings</code>:</p>
  
  <pre><code>REST_FRAMEWORK = {
      'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',),
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework.authentication.TokenAuthentication',
          'rest_framework.authentication.SessionAuthentication',
      ),
      'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend',),
      'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
      'PAGE_SIZE': 20,
      'DEFAULT_METADATA_CLASS': 'rest_framework.metadata.SimpleMetadata'
  }
  </code></pre>