diff --git a/databaze/urls.py b/databaze/urls.py index 5a1da5e..9a76f15 100644 --- a/databaze/urls.py +++ b/databaze/urls.py @@ -16,6 +16,8 @@ Including another URLconf from django.contrib import admin from django.urls import path +from novinky.views import index urlpatterns = [ path('admin/', admin.site.urls), + path('', index, name="index") ] diff --git a/novinky/models.py b/novinky/models.py index 29b2e6d..e985592 100644 --- a/novinky/models.py +++ b/novinky/models.py @@ -8,6 +8,9 @@ class Novinka(models.Model): datum = models.DateTimeField() autor = models.ForeignKey(User, on_delete=models.CASCADE) + def __str__(self) -> str: + return self.titulek + class Meta: verbose_name = "Novinka" verbose_name_plural = "novinky" diff --git a/novinky/templates/novinky/base.html b/novinky/templates/novinky/base.html new file mode 100644 index 0000000..e5fc4a6 --- /dev/null +++ b/novinky/templates/novinky/base.html @@ -0,0 +1,14 @@ + + + + + + + Document + + + {% block content %} + (nic tu zatim neni) + {% endblock %} + + \ No newline at end of file diff --git a/novinky/templates/novinky/index.html b/novinky/templates/novinky/index.html new file mode 100644 index 0000000..e69de29 diff --git a/novinky/views.py b/novinky/views.py index 91ea44a..b2bcd5e 100644 --- a/novinky/views.py +++ b/novinky/views.py @@ -1,3 +1,5 @@ from django.shortcuts import render # Create your views here. +def index(request): + return render(request, "novinky/index.html")