test tool1 template 사용 - class기반 뷰어 생성 1. App 아래에 templates 폴더 생성 - 아래에 home.html 파일 생성 Homepage 2. project setting.py의 templates 설정 'DIRS': [os.path.join(BASE_DIR, 'templates')], # templates 경로 추가 3. views.py 수정 from django.views.generic import TemplateView class HomePageView(TemplateView): template_name = 'home.html' 4. urls.py 수정 - Class-Based View 사용 # project_home/urls.py from django.urls import path, include # new urlpatterns =.. 2023. 4. 13. 이전 1 다음