framework2 [view] 상품 주문하기, 주문 정보 조회하기 product_detail.html 수정 product 앱 > templates > product.html 코드를 아래와 같이 수정해 주세요. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 {% extends "base.html" %} {% load humanize %} {% block contents %} # 상품명 가격 등록날짜 {% for product in product_list %} {{ product.id }} {{ product.name }} {{ product.price|intcomma }} 원 {{ product.register_date|date:'Y-m-d H:i' }} {% endf.. 2020. 8. 12. [view] 상품 목록 만들기 Views.py 수정 product > views.py 1 2 3 4 5 6 7 from django.shortcuts import render from django.views.generic import ListView, DetailView # Create your views here. class ProductList(ListView): model = Product template_name = 'product.html' context_object_name = 'product_list' urls 연결 fc_django > urls.py path('product/', ProductList.as_view()), 지난 글에서 설정했던 코드에서 product의 path도 추가해주세요. 1 2 3 4 5 6 7 8.. 2020. 7. 27. 이전 1 다음