diff --git a/products/templates/products/detail.html b/products/templates/products/detail.html index ad6e1c2..c10c6b8 100644 --- a/products/templates/products/detail.html +++ b/products/templates/products/detail.html @@ -13,16 +13,19 @@

{{ product.title }}

-
+
- + + +
-
+

Hunted by: {{ product.hunter.username }}

@@ -31,7 +34,7 @@

{{ product.pubdate_pretty }}

-
+

{{ product.body }}

diff --git a/products/templates/products/home.html b/products/templates/products/home.html index c2402fa..277b33d 100644 --- a/products/templates/products/home.html +++ b/products/templates/products/home.html @@ -5,4 +5,25 @@

{% endif %} + {% for product in products.all %} +
+
+ +
+
+

{{ product.title }}

+

{{ product.summary }}

+
+ +
+
+ {% csrf_token %} + +
+ {% endfor %} {% endblock %} diff --git a/products/views.py b/products/views.py index ffd1cf3..a99c5f1 100644 --- a/products/views.py +++ b/products/views.py @@ -5,7 +5,8 @@ from django.utils import timezone def home(request): - return render(request, 'products/home.html') + products = Product.objects + return render(request, 'products/home.html', {'products': products}) @login_required()