Skip to content

Commit

Permalink
#77 Feat: add csrf_exempt decorator and slove ssl error (#83)
Browse files Browse the repository at this point in the history
* #34 Feat: add all tickets list page

* #68 Feat: add application complete page

* #70 Feat: modify experiencea and reason field

* #64 Feat: Debug=False

* #81 Fix: remove api url

* #77 Feat: add csrf exempt decortor and slove ssl error

---------

Co-authored-by: 강지윤 <[email protected]>
  • Loading branch information
kjiyun and 강지윤 authored Feb 27, 2024
1 parent e53c3d1 commit 74a3553
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .config/nginx/kahluaproject.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen 80;
listen 80 ssl;
server_name *.compute.amazonaws.com *.kahluaband.com;
charset utf-8;
client_max_body_size 128M;
Expand Down
6 changes: 4 additions & 2 deletions application/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from django.shortcuts import render
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from rest_framework import status
from rest_framework.response import Response
from rest_framework.permissions import AllowAny
Expand All @@ -11,7 +13,7 @@
from application.models import ApplyForm
from application.serializers import ApplyFormCreateSerializer, ApplyFormCompleteSerializer


@method_decorator(csrf_exempt, name='dispatch')
class ApplyCreateView(CreateAPIView):
model = ApplyForm
serializer_class = ApplyFormCreateSerializer
Expand Down Expand Up @@ -95,7 +97,7 @@ def create(self, request, *args, **kwargs):
'status':'error'
}, status=status.HTTP_400_BAD_REQUEST)


@method_decorator(csrf_exempt, name='dispatch')
class ApplyCompleteView(APIView):
model = ApplyForm
serializer_class = ApplyFormCompleteSerializer
Expand Down
2 changes: 1 addition & 1 deletion tickets/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def delete(self, request, *args, **kwargs):



@method_decorator(csrf_exempt, name='dispatch')
# @method_decorator(csrf_exempt, name='dispatch')
class GeneralTicketOrderView(viewsets.ModelViewSet):
queryset = GeneralTicket.objects.all()
serializer_class = GeneralTicketDetailSerializer
Expand Down

0 comments on commit 74a3553

Please sign in to comment.