3 changed files with 22 additions and 1 deletions
@ -1,2 +1,15 @@ |
|||
{% extends "novinky/base.html" %} |
|||
|
|||
{% block content %} |
|||
<h1>Novinky</h1> |
|||
|
|||
{% for novinka in novinky %} |
|||
<h2>{{ novinka.titulek }}</h2> |
|||
{{ novinka.autor }} <br> |
|||
{{ novinka.datum }} <br> |
|||
<p> |
|||
{{ novinka.zprava }} |
|||
</p> |
|||
{% endfor %} |
|||
|
|||
{% endblock %} |
@ -1,5 +1,12 @@ |
|||
from django.shortcuts import render |
|||
|
|||
from novinky.models import Novinka |
|||
|
|||
|
|||
# Create your views here. |
|||
def index(request): |
|||
return render(request, "novinky/index.html") |
|||
novinky = Novinka.objects.all() |
|||
context = { |
|||
"novinky": novinky, |
|||
} |
|||
return render(request, "novinky/index.html", context) |
|||
|
Loading…
Reference in new issue