--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsub...@googlegroups.com.
Check if your response is getting cached.
On Tue, Dec 11, 2018 at 4:03 AM Wanderley S <wan...@gmail.com> wrote:
Hi, did you add permission_classes in your view or in your settings? If not I believe you sholud do something like:In your .views file:from rest_framework.permissions import IsAuthenticatedThen inside your class:Class SomeAPIView(APIView):permission_classes = (IsAuthenticated,).... the rest o your class....Regards.
Em Seg, 10 de dez de 2018 11:33, Akash utreja <utreja...@gmail.com escreveu:
Hi, I am using built in token authentication of django but I am getting weird error that some of my request got 200 and some of then got 401 unauthorized when I run it on server same with localhost. Both request have same token value I've checked multiple times.Can anyone tell what is thing i am missing. please help me out here!--My request header is like Authorization: Token <token key>
Here is my settings.py file containing.
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
)}Thanks
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Warm Regards,Arbaz
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAdminUser',
)
}
"
Take a look at documentation, there are very good examples there.
https://www.django-rest-framework.org/api-guide/permissions/
Regards,
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.