uspješna skripta, pokušaj rendera

This commit is contained in:
emaric 2024-01-10 12:29:03 +01:00
parent 6994f43490
commit c5fb12ffb8
9 changed files with 19 additions and 5 deletions

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>

View File

@ -1,11 +1,12 @@
from django.shortcuts import render
# Create your views here.
from rest_framework import viewsets
from .models import ObjektSigurnosti
from .serializers import ObjektSigurnostiSerializer
def home(request):
return render(request, 'base.html')
class ObjektSigurnostiViewSet(viewsets.ModelViewSet):
queryset = ObjektSigurnosti.objects.all()
serializer_class = ObjektSigurnostiSerializer

View File

@ -69,7 +69,7 @@ ROOT_URLCONF = 'plovidba_projekt.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [

View File

@ -15,8 +15,11 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.urls import path, include
from plovidba_aplikacija.views import home
urlpatterns = [
path('admin/', admin.site.urls),
]
path('api/', include('plovidba_aplikacija.urls')),
path('', home, name='base'),
]