[Django] Do it 장고 파헤치기 - 2 # ListView
·
프로그래밍/Back-end
장고가 제공하는 ListView에는 특별한 기능이 있다. template_name을 자동으로 유추하는 것 from django.views.generic import ListView from .models import Post class PostList(ListView): model = Post # template_name 은 [앱이름/모델이름(소문자)+'_list']으로 자동으로 유추한다. # template_name = 'blog/posts_list.html' 위 사항을 모르고 코드를 보면 도저히 어떻게 동작하는지 감이 오지 않을 것이다.