I created some APIs on the Django project using Django rest framework. I set IsAdminUser to permission classes.
When I run the project locally and make a request to it with auth info, it works.
I deployed it to AWS server by using Elastic Beanstalk and make a request, and it returns error 403
Authentication credentials were not provided
Here is my API
class HamListApiView(ListAPIView):
queryset = Ham.objects.all()
serializer_class = HamSerializer
permission_classes = [permissions.IsAdminUser]
What am I missing here?
My guess is that the server does not allow authorization header.
Usual issue with aws beanstalk
Try to add this to your container commands:
01_wsgipass:
command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With