title: HTTP method’s error: 401 (Unauthorized) on React & Django(DRF)
body: <p>I completed manipulating authentication with token by referring <a href="https://medium.com/swlh/django-rest-framework-with-react-jwt-authentication-part-1-a24b24fa83cd" rel="nofollow noreferrer">this article</a>, and then I’m trying to create a crud function such creating post, displaying posts, etc… . However, I have an error when I fetched the url which displays posts(IE, fetching url I defined as “index” method on views.py of app for auth manipulation), I have 401 error even though I can access by using url of the backend without any error even on terminal.</p>
  <p>I found some config codes which are related to authentication and permission for manipulation of authentication with token on settings.py causes this error, since when I delete these codes, the crud function works.  But obviously authentication function no longer works (index method on views.py retrieve only token, another informations are filled blank) by this solution.</p>
  <pre><code>//fetch method on frontend
  try{
                const res = await fetch(`${base_url}/accounts/current_user/`,{
                  method:'GET',
                  headers:{
                    Authorization:`JWT ${localStorage.getItem('token')}`
                  }
                })
                const data = await res.json();
          
                setUsername(data.username);
  
                console.log(data)
                
              }catch(err){console.log(err)};
  
  //fetch posts on frontend
  const getProblems = async() =&gt;{
              const res = await fetch(base_url+'/problems/index');
  
              const data = await res.json();
  
              setProblems(data);
          }
  
  //views.py on app for auth manipulation
  @api_view(['GET'])
  def get_current_user(request):
      serializer = GetFullUserSerializer(request.user)
      print(serializer.data)
      return Response(serializer.data)
  
  //settings.py(related to auth, cors):
  
  REST_FRAMEWORK = {
      'DEFAULT_PERMISSION_CLASSES': (
          'rest_framework.permissions.IsAuthenticated',
      ),
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
          'rest_framework.authentication.SessionAuthentication',
          'rest_framework.authentication.BasicAuthentication',
      )
  }
  
  CORS_ORIGIN_WHITELIST = (
      'http://localhost:3000',
  )
  
  CORS_ALLOW_CREDENTIALS = True
  
  JWT_AUTH = {
      'JWT_RESPONSE_PAYLOAD_HANDLER':
      'new_sns.utils.custom_jwt_response_handler',   
  }
  
  
  </code></pre>
  <p>I have another files such serializer.py, urls.py,but they are absolutely same as the article I extracted.</p>
  <p>I guess I misunderstand something around configuration. I would like to hear some of suggestions. Please let me know if you think if there may be problems on another files which I didn't attach on here.</p>
  <p>Thanks.</p>