tdd1 [기술면접] 4일차 문답 | FBV CBV 테스트코드 TDD FBV와 CBV는 각각 무엇이며, 어떤 차이가 있습니까? Function-Base Views 함수 기반 뷰 함수기반 뷰는 뷰를 작성할때 함수로 작성하는 방식 # views.py @api_view([‘GET’, ‘POST’]) def index(request): if request.method == ‘POST’: return HTTPResponse(“post method”) if request.method == ‘GET’: #else: return HTTPResponse(“get method”) Class-Based Views 클래스 기반 뷰 클래스 기반뷰는 클래스 형식으로 작성하는 방식 From django.views import View Class NewView(View): def get(self, r.. 2023. 7. 24. 이전 1 다음