I've deployed a project on Elastic Beanstalk and I can't figure out why Django Rest Framework returns this response:
Authentication credentials were not provided.
when I go to ../api/article
I'm sending header - Authorization: Token
curl -X GET http://environment.eba-etpcqsqk.us-west-1.elasticbeanstalk.com/api/article/ -H 'Authorization: Token MYTOKEN'
{"detail":"Authentication credentials were not provided."}
Views:
class ArticleViewSet(ModelViewSet):
queryset = Article.objects.all()
serializer_class = ArticleSerializer
pagination_class = StandardResultsSetPagination
filterset_class = ArticleFilter
# user must be either logged in or must provide AUTH TOKEN
authentication_classes = [TokenAuthentication, SessionAuthentication]
permission_classes = [IsAuthenticated]
I've DEBUG=True
and it works on the development server. Do you know where is the problem? Maybe EBS doesn't forward Headers?