Commit e7b03705 by Patryk Czarnik

odczyt czasu - wersja początkowa

parent 5cbe5a9f
from django.http import HttpResponse
from django.shortcuts import render
from datetime import datetime
# Create your views here.
def hello(request):
return HttpResponse('Hello world')
# Dopisz funkcję, która zwraca bieżący czas
def podaj_czas(request):
dt = datetime.now()
return HttpResponse(dt)
# uwzględnij tę funkcję w urls
# i przetestuj w przeglądarce
......@@ -19,8 +19,10 @@ from django.contrib import admin
from django.urls import path
from aplikacja.views import hello
from aplikacja.views import podaj_czas
urlpatterns = [
path("admin/", admin.site.urls),
path("hello", hello),
path("czas", podaj_czas),
]
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