
3 changed files with 24 additions and 2 deletions
@ -1 +1,15 @@ |
|||||
{% extends "novinky/base.html" %} |
|
||||
|
{% 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 django.shortcuts import render |
||||
|
|
||||
|
from novinky.models import Novinka |
||||
|
|
||||
|
|
||||
# Create your views here. |
# Create your views here. |
||||
def index(request): |
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