Commit ce2ca192 by Patryk Czarnik

Pierwszy szablon

parent 7284e776
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>Jaki mamy czas?</title>
</head>
<body>
<h1>Strona podająca czas</h1>
<p>Zaraz napiszę, która jest godzina.</p>
<p>Otóż tą godziną jest {{godz}} !</p>
</body>
</html>
\ No newline at end of file
......@@ -25,3 +25,9 @@ def czas_html(request:HttpRequest) -> HttpResponse:
return HttpResponse(html)
def czas_szablon(request:HttpRequest) -> HttpResponse:
godzina = datetime.now().strftime('%H:%M:%S')
return render(request=request,
template_name='szablon_dla_czasu.html',
context={'godz': godzina})
......@@ -23,4 +23,5 @@ urlpatterns = [
path("hello", hello),
path("czas.txt", czas_txt),
path("czas.html", czas_html),
path("czas_szablon", czas_szablon),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment