uspješna skripta, pokušaj rendera
This commit is contained in:
parent
6994f43490
commit
c5fb12ffb8
BIN
plovidba_aplikacija/__pycache__/serializers.cpython-38.pyc
Normal file
BIN
plovidba_aplikacija/__pycache__/serializers.cpython-38.pyc
Normal file
Binary file not shown.
BIN
plovidba_aplikacija/__pycache__/urls.cpython-38.pyc
Normal file
BIN
plovidba_aplikacija/__pycache__/urls.cpython-38.pyc
Normal file
Binary file not shown.
BIN
plovidba_aplikacija/__pycache__/views.cpython-38.pyc
Normal file
BIN
plovidba_aplikacija/__pycache__/views.cpython-38.pyc
Normal file
Binary file not shown.
10
plovidba_aplikacija/templates/plovidba_aplikacija/base.html
Normal file
10
plovidba_aplikacija/templates/plovidba_aplikacija/base.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<h1>My First Heading</h1>
|
||||
|
||||
<p>My first paragraph.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -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
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@ -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': [
|
||||
|
||||
@ -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'),
|
||||
]
|
||||
Loading…
x
Reference in New Issue
Block a user