using permission required

2018-11-14 Thread Akash utreja
I am trying to use permission required decorator using authorization header.And it always gives me 302 error. although my user has permission for it.Kindly help I am beginner to django. Here is my code @permission_required('access_admin', login_url=None) @permission_classes((IsAuthenticated,)) @

Django token base authentication using python

2018-11-18 Thread Akash utreja
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.LimitOffsetPaginatio

Authorization not working on production server

2018-12-07 Thread Akash utreja
Hi, I am building authorization in django framework using python.. The problem is that my code is working fine on local server but when I run the same in production it returns "Anonymous User" Am I doing it right? if request.user.has_perm('auth.access_admin') ""whole code"" else: return