5 changed files with 39 additions and 0 deletions
@ -0,0 +1,14 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|||
<title>Novinky</title> |
|||
</head> |
|||
<body> |
|||
{% block content %} |
|||
(nic tu není) |
|||
{% endblock %} |
|||
</body> |
|||
</html> |
@ -0,0 +1,15 @@ |
|||
{% extends "novinky/base.html" %} |
|||
|
|||
{% block content %} |
|||
<h1>Novinky</h1> |
|||
|
|||
{% for novinka in novinky %} |
|||
{{ novinka.datum }} <br> |
|||
{{ novinka.autor }} |
|||
<h2>{{ novinka.titulek }}</h2> |
|||
<p> |
|||
{{ novinka.zprava }} |
|||
</p> |
|||
{% endfor %} |
|||
|
|||
{% endblock %} |
@ -1,3 +1,10 @@ |
|||
from django.shortcuts import render |
|||
from novinky.models import Novinka |
|||
|
|||
# Create your views here. |
|||
def index(request): |
|||
novinky = Novinka.objects.all() |
|||
context = { |
|||
"novinky": novinky, |
|||
} |
|||
return render(request, "novinky/index.html", context) |
|||
|
Loading…
Reference in new issue