Django Rest Framework - Authentication credentials were not provided Django Rest Framework - Authentication credentials were not provided python python

Django Rest Framework - Authentication credentials were not provided


If you are running Django on Apache using mod_wsgi you have to add

WSGIPassAuthorization On

in your httpd.conf. Otherwise, the authorization header will be stripped out by mod_wsgi.


Solved by adding "DEFAULT_AUTHENTICATION_CLASSES" to my settings.py

REST_FRAMEWORK = {   'DEFAULT_AUTHENTICATION_CLASSES': (       'rest_framework.authentication.TokenAuthentication',   ),   'DEFAULT_PERMISSION_CLASSES': (        'rest_framework.permissions.IsAdminUser'   ),}


This help me out without "DEFAULT_PERMISSION_CLASSES" in my settings.py

REST_FRAMEWORK = {    'DEFAULT_AUTHENTICATION_CLASSES': (        'rest_framework.authentication.TokenAuthentication',        'rest_framework.authentication.SessionAuthentication',    ),    'PAGE_SIZE': 10}