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
24074499
Commit
24074499
authored
Dec 12, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rozmowa
parent
72a0277a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
rozmowa.html
mojprojekt/aplikacja/templates/rozmowa.html
+24
-0
views.py
mojprojekt/aplikacja/views.py
+7
-0
urls.py
mojprojekt/mojprojekt/urls.py
+1
-0
No files found.
mojprojekt/aplikacja/templates/rozmowa.html
0 → 100644
View file @
24074499
<!DOCTYPE html>
{% load static %}
<html
lang=
"pl"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Rozmowa
</title>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"{% static 'styl.css' %}"
>
</head>
<body>
<h1>
Rozmowa z Pythonem
</h1>
<form>
<label
for=
"imie"
>
Jak masz na imię?
</label><br>
<input
type=
"text"
name=
"imie"
id=
"imie"
><br>
<button>
Wyślij
</button>
</form>
<div
class=
"wynik"
>
{{powitanie}}
</div>
</body>
</html>
\ No newline at end of file
mojprojekt/aplikacja/views.py
View file @
24074499
...
@@ -35,3 +35,10 @@ def czas_szablon(request:HttpRequest) -> HttpResponse:
...
@@ -35,3 +35,10 @@ def czas_szablon(request:HttpRequest) -> HttpResponse:
def
index
(
request
:
HttpRequest
)
->
HttpResponse
:
def
index
(
request
:
HttpRequest
)
->
HttpResponse
:
return
render
(
request
=
request
,
template_name
=
'index.html'
)
return
render
(
request
=
request
,
template_name
=
'index.html'
)
def
rozmowa
(
request
:
HttpRequest
)
->
HttpResponse
:
imie
=
request
.
GET
.
get
(
'imie'
,
'Anonim'
)
powitanie
=
f
'Witaj {imie}!'
return
render
(
request
=
request
,
template_name
=
'rozmowa.html'
,
context
=
{
'powitanie'
:
powitanie
})
mojprojekt/mojprojekt/urls.py
View file @
24074499
...
@@ -25,4 +25,5 @@ urlpatterns = [
...
@@ -25,4 +25,5 @@ urlpatterns = [
path
(
"czas.txt"
,
czas_txt
),
path
(
"czas.txt"
,
czas_txt
),
path
(
"czas.html"
,
czas_html
),
path
(
"czas.html"
,
czas_html
),
path
(
"czas_szablon"
,
czas_szablon
),
path
(
"czas_szablon"
,
czas_szablon
),
path
(
"rozmowa"
,
rozmowa
),
]
]
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