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')
|
||||
|
||||
@@ -8,6 +8,7 @@ from rest_framework import status
|
||||
|
||||
|
||||
class HomeView(APIView):
|
||||
authentication_classes = []
|
||||
def get(self, request):
|
||||
|
||||
dollor_object, _ = DollorModel.objects.get_or_create(unique_filed='unique')
|
||||
|
||||
@@ -24,6 +24,7 @@ from rest_framework.permissions import AllowAny
|
||||
|
||||
class AllCategories(APIView):
|
||||
serializer_class = MainCategorySerializer
|
||||
authentication_classes = []
|
||||
@extend_schema(
|
||||
# parameters=[
|
||||
# OpenApiParameter(
|
||||
@@ -50,6 +51,7 @@ class AllCategories(APIView):
|
||||
class ProductView(APIView):
|
||||
serializer_class = ProductSerializer
|
||||
permission_classes = [AllowAny]
|
||||
authentication_classes = []
|
||||
def get(self, request, pk):
|
||||
product = get_object_or_404(ProductModel, id=pk)
|
||||
dollor_object, _ = DollorModel.objects.get_or_create(unique_filed='unique')
|
||||
@@ -61,7 +63,7 @@ class ProductView(APIView):
|
||||
class AllProductsView(APIView):
|
||||
serializer_class = ProductSerializer
|
||||
pagination_class = StructurePagination
|
||||
|
||||
authentication_classes = []
|
||||
@extend_schema(
|
||||
parameters=[
|
||||
OpenApiParameter(
|
||||
|
||||
Reference in New Issue
Block a user