title: Django Admin authentication credentials not provided - HTTP 401
body: <p>My Django app is not recognizing the credentials in the admin panel for some models. I can login, view part of the models, but for some others I see the following error message:</p>
  
  <pre><code>{"detail":"Authentication credentials were not provided."}
  </code></pre>
  
  <p>Interesting: there are models I can see but when I click on "Add" to add an entry, I see the error message.</p>
  
  <p>Among others, I am using the following libraries:</p>
  
  <pre><code>Django==2.0.9
  django-cors-headers==2.4.0
  django-extensions==2.1.3
  django-storages==1.7.1
  djangorestframework==3.8.2
  djangorestframework-jwt==1.11.0
  </code></pre>
  
  <p>In my settings.py I have the following:</p>
  
  <pre><code>INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
  
      'corsheaders',
      'django_extensions',
      'storages',
  
      'rest_framework',
  
      'authentication.apps.AuthenticationConfig',
      'directory.apps.DirectoryConfig',
      'metacontent.apps.MetacontentConfig',
  ]
  
  MIDDLEWARE = [
      'django.middleware.security.SecurityMiddleware',
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  
      'corsheaders.middleware.CorsMiddleware',
      'django.middleware.common.CommonMiddleware',
  ]
  </code></pre>
  
  <p>and also:</p>
  
  <pre><code>REST_FRAMEWORK = {
      'DEFAULT_PERMISSION_CLASSES': (
          #'rest_framework.permissions.IsAuthenticated', #removed for open docs access
      ),
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
          'rest_framework.authentication.SessionAuthentication',
          'rest_framework.authentication.BasicAuthentication',
      ),
      'DEFAULT_RENDERER_CLASSES': (
          'rest_framework.renderers.JSONRenderer',
      ),
      'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
      'PAGE_SIZE': 100,
      'DEFAULT_THROTTLE_CLASSES': (
          'rest_framework.throttling.AnonRateThrottle',
      ),
      'DEFAULT_THROTTLE_RATES': {
          'anon': '1000/hour',
          'user': '6000/hour',
      },
  }
  </code></pre>
  
  <p>When the request is NOT working, the headers of the response are the following:</p>
  
  <pre><code>HTTP/1.1 401 Unauthorized
  Date: Fri, 02 Nov 2018 21:50:27 GMT
  Server: Apache/2.4.34 (Amazon) mod_wsgi/3.5 Python/3.6.5
  Allow: GET, HEAD, OPTIONS
  Vary: Origin
  X-Frame-Options: SAMEORIGIN
  WWW-Authenticate: JWT realm="api"
  Content-Length: 58
  Keep-Alive: timeout=5, max=100
  Connection: Keep-Alive
  Content-Type: application/json
  </code></pre>
  
  <p>And when it is working:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Fri, 02 Nov 2018 21:50:28 GMT
  Server: Apache/2.4.34 (Amazon) mod_wsgi/3.5 Python/3.6.5
  Expires: Fri, 02 Nov 2018 21:50:29 GMT
  Cache-Control: max-age=0, no-cache, no-store, must-revalidate
  Vary: Cookie,Origin
  X-Frame-Options: SAMEORIGIN
  Set-Cookie: csrftoken=8Aw8toVirE5qLSt79Nhh5tDem59qLChCrZ3i7zKkLo2NzS1UZ37SVDpjl; expires=Fri, 01-Nov-2019 21:50:29 GMT; Max-Age=31449600; Path=/
  Content-Length: 3876
  Keep-Alive: timeout=5, max=99
  Connection: Keep-Alive
  Content-Type: text/html; charset=utf-8
  </code></pre>
  
  <p>I thought about "WSGIPassAuthorization On" but if that were the issue, it would never work. Also, I have the issue both on localhost (mac) and on server (Apache with WSGIPassAuthorization On).
  What am I missing? Your help would be much appreciated.</p>