diff --git a/novinky/templates/novinky/novinka.html b/novinky/templates/novinky/novinka.html index 2dc7467..d378f7a 100644 --- a/novinky/templates/novinky/novinka.html +++ b/novinky/templates/novinky/novinka.html @@ -3,8 +3,13 @@ {% block content %} -Toto je novinka +

{{ novinka.titulek }}

+{{ novinka.autor }}
+{{ novinka.datum }}
+

+ {{ novinka.zprava }} +

zpět -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/novinky/views.py b/novinky/views.py index 1778bd7..4ba6e7a 100644 --- a/novinky/views.py +++ b/novinky/views.py @@ -13,5 +13,7 @@ def index(request): def novinka(request, novinka_id): - - return render(request, "novinky/novinka.html") + context = { + "novinka": Novinka.objects.get(id=novinka_id), + } + return render(request, "novinky/novinka.html", context)