|
|
|
@ -300,14 +300,25 @@ class CategoriesBySectView(ListAPIView): |
|
|
|
def get(self, request, *args, **kwargs): |
|
|
|
return self.list(request, *args, **kwargs) |
|
|
|
|
|
|
|
from rest_framework.decorators import api_view |
|
|
|
from rest_framework.decorators import api_view, permission_classes, authentication_classes |
|
|
|
from rest_framework.permissions import AllowAny |
|
|
|
from rest_framework.response import Response |
|
|
|
from rest_framework import status |
|
|
|
|
|
|
|
@api_view(['GET']) |
|
|
|
@api_view(['GET', 'POST']) |
|
|
|
@permission_classes([AllowAny]) # Let anyone access this |
|
|
|
@authentication_classes([]) # Disable auth so we don't get 403 |
|
|
|
def test_deploy(request): |
|
|
|
""" |
|
|
|
List all transformers, or create a new transformer |
|
|
|
""" |
|
|
|
if request.method == 'GET': |
|
|
|
return Response('test_deploy') |
|
|
|
# This filters all headers Django receives and returns them as JSON |
|
|
|
headers = { |
|
|
|
k: v for k, v in request.META.items() |
|
|
|
if k.startswith('HTTP_') or k == 'CONTENT_TYPE' |
|
|
|
} |
|
|
|
|
|
|
|
# Also check if Authentication settings are actually active |
|
|
|
from django.conf import settings |
|
|
|
auth_settings = settings.REST_FRAMEWORK.get('DEFAULT_AUTHENTICATION_CLASSES', 'NOT SET') |
|
|
|
|
|
|
|
return Response({ |
|
|
|
"received_headers": headers, |
|
|
|
"active_auth_settings": auth_settings |
|
|
|
}) |