@api_view(['GET',])
@permission_classes([IsAuthenticated])
def Reservation_get(request):
if request.method == 'GET':
Date = request.data['date']
ress = reservation.objects.filter(date=Date)
serializer = ReservationSerializer(ress, many=True)
if ress.exists():
response = {'message': 'this/these date already chosen in restaurant', 'result': serializer.data}
return Response(response)
else:
return Response(serializer.data)
мои взгляды
моя ошибка
File "D:\#py\git projects\company Project\last\api\reservation\views.py", line 68, in Reservation_get
Date = request.data['date']
KeyError: 'date'
[21/Mar/2020 03:29:19] "GET /reservation_get/ HTTP/1.1" 500 99859
мой GET работает на почтальоне, но на нормальный URL покажи мне ошибку