Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kurs_alx_pcz
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
kurs_alx_pcz
Commits
ce2ca192
Commit
ce2ca192
authored
Dec 12, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pierwszy szablon
parent
7284e776
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
szablon_dla_czasu.html
mojprojekt/aplikacja/templates/szablon_dla_czasu.html
+14
-0
views.py
mojprojekt/aplikacja/views.py
+6
-0
urls.py
mojprojekt/mojprojekt/urls.py
+1
-0
No files found.
mojprojekt/aplikacja/templates/szablon_dla_czasu.html
0 → 100644
View file @
ce2ca192
<!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
mojprojekt/aplikacja/views.py
View file @
ce2ca192
...
...
@@ -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
})
mojprojekt/mojprojekt/urls.py
View file @
ce2ca192
...
...
@@ -23,4 +23,5 @@ urlpatterns = [
path
(
"hello"
,
hello
),
path
(
"czas.txt"
,
czas_txt
),
path
(
"czas.html"
,
czas_html
),
path
(
"czas_szablon"
,
czas_szablon
),
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment