Skip to content

Commit

Permalink
chore: 인증 방식 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dkfla authored and ybkang1108 committed Aug 5, 2024
1 parent c1dd658 commit 7e9bc65
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions restaurants/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
RestaurantDetailSerializer,
)

# from rest_framework.authentication import TokenAuthentication
# from rest_framework.permissions import IsAuthenticated
# from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
import logging
Expand All @@ -26,9 +28,9 @@ def restaurant_list(request):
return Response(serializer.data)


@csrf_exempt
@api_view(["GET", "POST", "DELETE"])
# @login_required
# @authentication_classes([TokenAuthentication])
# @permission_classes([IsAuthenticated])
def search(request):
user = User.objects.get(id=21) # 임시 유저 지정, 추후 삭제
if request.method == "GET":
Expand Down Expand Up @@ -138,9 +140,9 @@ def add_remove_restaurant(request, pk):
)


@csrf_exempt
@api_view(["GET"])
# @login_required
# @authentication_classes([TokenAuthentication])
# @permission_classes([IsAuthenticated])
def restaurant_detail(request, pk):
try:
restaurant = Restaurant.objects.prefetch_related("reviews").get(pk=pk)
Expand Down

0 comments on commit 7e9bc65

Please sign in to comment.