diff --git a/databaze/urls.py b/databaze/urls.py index fcb8e88..5cfcea9 100644 --- a/databaze/urls.py +++ b/databaze/urls.py @@ -16,9 +16,10 @@ Including another URLconf from django.contrib import admin from django.urls import path -from novinky.views import index +from novinky.views import index, novinka urlpatterns = [ path('admin/', admin.site.urls), + path('novinka//', novinka, name="novinka"), path('', index, name="index"), ] diff --git a/novinky/templates/novinky/index.html b/novinky/templates/novinky/index.html index bc121cc..73387ef 100644 --- a/novinky/templates/novinky/index.html +++ b/novinky/templates/novinky/index.html @@ -8,8 +8,10 @@ {{ novinka.autor }}
{{ novinka.datum }}

- {{ novinka.zprava }} + {{ novinka.zprava|truncatewords:5 }} + více

{% endfor %} -{% endblock %} \ No newline at end of file +{% endblock %} + diff --git a/novinky/templates/novinky/novinka.html b/novinky/templates/novinky/novinka.html new file mode 100644 index 0000000..2dc7467 --- /dev/null +++ b/novinky/templates/novinky/novinka.html @@ -0,0 +1,10 @@ +{% extends "novinky/base.html" %} + + +{% block content %} + +Toto je novinka + +zpět + +{% endblock %} \ No newline at end of file diff --git a/novinky/views.py b/novinky/views.py index 2427903..1778bd7 100644 --- a/novinky/views.py +++ b/novinky/views.py @@ -10,3 +10,8 @@ def index(request): "novinky": novinky, } return render(request, "novinky/index.html", context) + + +def novinka(request, novinka_id): + + return render(request, "novinky/novinka.html")