Commit afeb8d24 by Patryk Czarnik

Funkcja czas

parent 4aa434cf
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import render from django.shortcuts import render
from datetime import datetime
# Create your views here. # Create your views here.
def hello(request): def hello(request):
return HttpResponse('Hello Django!') return HttpResponse('Hello <b style="color:blue">Django</b>!')
def daj_czas(request):
return HttpResponse(datetime.now())
...@@ -17,9 +17,10 @@ Including another URLconf ...@@ -17,9 +17,10 @@ Including another URLconf
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path
from aplikacja.views import hello from aplikacja.views import hello, daj_czas
urlpatterns = [ urlpatterns = [
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("", hello), path("hello", hello),
path("czas", daj_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