Nakon uredjivanja baze

This commit is contained in:
emaric 2024-01-08 14:13:38 +01:00
parent b291d2e08f
commit b6454c5f78
12 changed files with 27 additions and 3 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,23 @@
# Generated by Django 4.2.9 on 2024-01-08 12:23
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ObjektSigurnosti',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('lokacija', django.contrib.gis.db.models.fields.PointField(srid=4326)),
('naziv', models.CharField(max_length=255)),
],
),
]

View File

@ -9,4 +9,3 @@ class ObjektSigurnosti(models.Model):
lokacija = models.PointField()
naziv = models.CharField(max_length=255)

View File

@ -9,3 +9,4 @@ from .serializers import ObjektSigurnostiSerializer
class ObjektSigurnostiViewSet(viewsets.ModelViewSet):
queryset = ObjektSigurnosti.objects.all()
serializer_class = ObjektSigurnostiSerializer

Binary file not shown.

View File

@ -17,6 +17,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# dodano
import os
import GDAL
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -51,7 +52,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'plovidba_projekt',
'plovidba_aplikacija',
]
MIDDLEWARE = [
@ -93,7 +94,7 @@ DATABASES = {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'plovidba_db',
'USER': 'postgres',
'PASSWORD': 'test123',
'PASSWORD': 'postgres',
'HOST': 'localhost',
'PORT': '5432',
}