Django token base authentication using python

9 views
Skip to first unread message

Akash utreja

unread,
Nov 19, 2018, 12:39:03 AM11/19/18
to Django users
Hi I am trying to build an authentication system. I have added following in my setting.py file
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.TokenAuthentication',
    ),
    'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination'
}
And I also added decorators in my each api functional views as following
@permission_classes((IsAuthenticated,))
Now I am making request to api using token so some them are accessible but some get unauthorized.And these api which get unathorized are random mean not a particular api get unauthorized. 
Am I missing something?Please help me out here!
Thanks
Akash
Reply all
Reply to author
Forward
0 new messages