Example #1
0
 def as_view(cls, *args, **kwargs):
     view = super().as_view(*args, **kwargs)
     view = permission_classes((IsAuthenticated,))(view)
     view = authentication_classes(api_settings.DEFAULT_AUTHENTICATION_CLASSES)(view)
     view = parser_classes([JSONParser])(view)
     view = throttle_classes(api_settings.DEFAULT_THROTTLE_CLASSES)(view)
     view = api_view(["GET", "POST"])(view)
     view = csrf_exempt(view)
     return view
Example #2
0
    def as_view(cls, *args, **kwargs):
        view = super(AuthenticatedGraphQLView, cls).as_view(*args, **kwargs)
        view = permission_classes((IsAuthenticated, ))(view)
        view = authentication_classes(
            api_settings.DEFAULT_AUTHENTICATION_CLASSES)(view)
        view = throttle_classes(api_settings.DEFAULT_THROTTLE_CLASSES)(view)
        view = api_view(['GET', 'POST'])(view)

        return view
Example #3
0
class ArticleDetail(generics.RetrieveUpdateDestroyAPIView):
    logger.info("/articles detail API got called..")
    renderer_classes = (JSONRenderer, )
    throttle_classes([UserRateThrottle])
    queryset = Article.objects.all()
    serializer_class = ArticleSerializer