Commit 4e6a7afc by Patryk Czarnik

pole daty

parent e217bcad
......@@ -10,6 +10,9 @@
<label for="imie">Jak masz na imię?</label>
<input type="text" name="imie" id="imie">
<br>
<label for="data_ur">Podaj datę urodzenia</label>
<input type="date" name="data_ur" id="data_ur">
<br>
<button>Wyślij</button>
</form>
......
......@@ -45,11 +45,13 @@ def czas_szablon(request:HttpRequest) -> HttpResponse:
def rozmowa(request:HttpRequest) -> HttpResponse:
powitanie = 'Hej, może się przedstawisz?'
try:
imie = request.GET['imie']
if imie:
powitanie = f'Witaj {imie}'
except KeyError:
powitanie = 'Hej, może się przedstawisz?'
pass
return render(request, 'rozmowa.html',
context={'message': powitanie})
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