add auth class
This commit is contained in:
@@ -12,6 +12,7 @@ from drf_spectacular.utils import extend_schema, OpenApiParameter, OpenApiTypes
|
||||
class AllBlogView(APIView):
|
||||
serializer_class = AllBlogSerilizer
|
||||
pagination_class = StructurePagination
|
||||
authentication_classes = []
|
||||
@extend_schema(
|
||||
parameters=[
|
||||
OpenApiParameter(
|
||||
@@ -43,7 +44,7 @@ class AllBlogView(APIView):
|
||||
|
||||
class BlogView(APIView):
|
||||
serializer_class = BlogSerilizer
|
||||
|
||||
authentication_classes = []
|
||||
def get_client_ip(self, request):
|
||||
"""Helper function to get the client IP from request headers."""
|
||||
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
|
||||
|
||||
Reference in New Issue
Block a user