Compare commits
10 Commits
b6454c5f78
...
3931fc57bf
| Author | SHA1 | Date | |
|---|---|---|---|
| 3931fc57bf | |||
| 6614ae2e44 | |||
| eaac31978f | |||
| c5fb12ffb8 | |||
| 6994f43490 | |||
| 3709991263 | |||
| 7c144293a3 | |||
| 7d2df70d53 | |||
| 1b80bda3d5 | |||
| b89fde9c92 |
Binary file not shown.
Binary file not shown.
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.
@ -1,3 +1,6 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
from .models import ObjektSigurnosti
|
||||
|
||||
admin.site.register(ObjektSigurnosti)
|
||||
0
plovidba_aplikacija/management/commands/__init__.py
Normal file
0
plovidba_aplikacija/management/commands/__init__.py
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,69 @@
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.contrib.gis.geos import Point
|
||||
from plovidba_aplikacija.models import ObjektSigurnosti
|
||||
from django.db import transaction
|
||||
|
||||
# dodani podaci
|
||||
class Command(BaseCommand):
|
||||
help = """
|
||||
Programatically create entries for plovidba_aplikacija model ObjektSigurnosti
|
||||
"""
|
||||
def handle(self, *args, **options):
|
||||
json_rpath = os.path.join(settings.RESOURCES_DIR, 'testnipodaci.json')
|
||||
|
||||
created_entries = 0
|
||||
existing_entries = 0
|
||||
|
||||
with open(json_rpath, encoding='utf-8') as r:
|
||||
data = json.load(r)
|
||||
|
||||
with transaction.atomic():
|
||||
for feature in data.get('features', []):
|
||||
properties = feature.get('properties', {})
|
||||
geometry = feature.get('geometry', {})
|
||||
|
||||
latitude = geometry.get('coordinates', [])[1]
|
||||
longitude = geometry.get('coordinates', [])[0]
|
||||
naziv_objekta = properties.get('naziv_objekta', '')
|
||||
ps_br = properties.get('ps_br', None)
|
||||
e_br = properties.get('e_br', None)
|
||||
tip_objekta = properties.get('tip_objekta', None)
|
||||
lucka_kapetanija = properties.get('lucka_kapetanija', None)
|
||||
fotografija = properties.get('fotografija', '')
|
||||
id_ais = properties.get('id_ais', None)
|
||||
simbol_oznaka = properties.get('simbol_oznaka', '')
|
||||
|
||||
if not (isinstance(latitude, (float, int)) and isinstance(longitude, (float, int))):
|
||||
continue
|
||||
|
||||
if not (naziv_objekta and latitude and longitude):
|
||||
continue
|
||||
|
||||
print(f"Latitude: {latitude}, Longitude: {longitude}, Naziv Objekta: {naziv_objekta}")
|
||||
|
||||
|
||||
obj, created = ObjektSigurnosti.objects.get_or_create(
|
||||
naziv=naziv_objekta,
|
||||
lokacija=Point(float(longitude), float(latitude)),
|
||||
ps_br = ps_br,
|
||||
e_br = e_br,
|
||||
tip_objekta = tip_objekta,
|
||||
lucka_kapetanija = lucka_kapetanija,
|
||||
fotografija = fotografija,
|
||||
id_ais = id_ais,
|
||||
simbol_oznaka = simbol_oznaka,
|
||||
)
|
||||
if created:
|
||||
created_entries +=1
|
||||
print("Kreiran OS {} - {}".format(obj.naziv, obj.lokacija))
|
||||
else:
|
||||
existing_entries += 1
|
||||
print("Existing OS {} - {}".format(obj.naziv, obj.lokacija))
|
||||
|
||||
print("Created: {}".format(created_entries))
|
||||
print("Existing:".format(existing_entries))
|
||||
File diff suppressed because one or more lines are too long
@ -16,7 +16,6 @@ class Migration(migrations.Migration):
|
||||
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)),
|
||||
],
|
||||
),
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
# Generated by Django 4.2.9 on 2024-01-08 14:35
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('plovidba_aplikacija', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='lat',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='lon',
|
||||
field=models.FloatField(default=0.0),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.9 on 2024-01-09 08:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('plovidba_aplikacija', '0002_remove_objektsigurnosti_lokacija_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='nazi1v',
|
||||
field=models.CharField(default='test', max_length=255),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,17 @@
|
||||
# Generated by Django 4.2.9 on 2024-01-09 08:13
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('plovidba_aplikacija', '0003_objektsigurnosti_nazi1v'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='objektsigurnosti',
|
||||
name='nazi1v',
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.9 on 2024-01-09 08:16
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('plovidba_aplikacija', '0004_remove_objektsigurnosti_nazi1v'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='lokacija',
|
||||
field=django.contrib.gis.db.models.fields.PointField(null=True, srid=4326),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,19 @@
|
||||
# Generated by Django 4.2.9 on 2024-01-09 08:16
|
||||
|
||||
import django.contrib.gis.db.models.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('plovidba_aplikacija', '0005_objektsigurnosti_lokacija'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='objektsigurnosti',
|
||||
name='lokacija',
|
||||
field=django.contrib.gis.db.models.fields.PointField(null=True, srid=3765),
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,21 @@
|
||||
# Generated by Django 4.2.9 on 2024-01-09 08:41
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('plovidba_aplikacija', '0006_alter_objektsigurnosti_lokacija'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='objektsigurnosti',
|
||||
name='lat',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='objektsigurnosti',
|
||||
name='lon',
|
||||
),
|
||||
]
|
||||
@ -0,0 +1,48 @@
|
||||
# Generated by Django 4.2.9 on 2024-01-10 12:35
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('plovidba_aplikacija', '0007_remove_objektsigurnosti_lat_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='e_br',
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='fotografija',
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='id_ais',
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='lucka_kapetanija',
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='ps_br',
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='simbol_oznaka',
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='objektsigurnosti',
|
||||
name='tip_objekta',
|
||||
field=models.IntegerField(blank=True, null=True),
|
||||
),
|
||||
]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,11 +1,27 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
|
||||
|
||||
from django.contrib.gis.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from django.utils import timezone
|
||||
|
||||
class ObjektSigurnosti(models.Model):
|
||||
lokacija = models.PointField()
|
||||
naziv = models.CharField(max_length=255)
|
||||
lokacija = models.PointField(null=True, srid=3765)
|
||||
ps_br = models.CharField(max_length=255, null=True, blank=True)
|
||||
e_br = models.CharField(max_length=255, null=True, blank=True)
|
||||
tip_objekta = models.IntegerField(null=True, blank=True)
|
||||
lucka_kapetanija = models.CharField(max_length=255, null=True, blank=True)
|
||||
fotografija = models.CharField(max_length=255, null=True, blank=True)
|
||||
id_ais = models.CharField(max_length=255, null=True, blank=True)
|
||||
simbol_oznaka = models.CharField(max_length=255, null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.naziv
|
||||
|
||||
# class Log(models.Model):
|
||||
# user = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
# akcija = models.CharField(max_length=255)
|
||||
# opis = models.TextField()
|
||||
# vrijeme = models.DateTimeField(default=timezone.now)
|
||||
|
||||
# def __str__(self):
|
||||
# return f"{self.user.username} - {self.akcija} - {self.opis}"
|
||||
@ -1,10 +1,8 @@
|
||||
from django.urls import path, include
|
||||
from rest_framework.routers import DefaultRouter
|
||||
from .views import ObjektSigurnostiViewSet
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register(r'objekti', ObjektSigurnostiViewSet, basename='objekt-sigurnosti')
|
||||
from django.urls import path, include
|
||||
from .views import ObjektSigurnostiList, ObjektSigurnostiDetail
|
||||
|
||||
urlpatterns = [
|
||||
path('', include(router.urls)),
|
||||
]
|
||||
path('objekti/', ObjektSigurnostiList.as_view(), name='objektisigurnosti-list'),
|
||||
path('objekti/<int:pk>/', ObjektSigurnostiDetail.as_view(), name='objektisigurnosti-detail' ),
|
||||
]
|
||||
|
||||
@ -1,12 +1,45 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
|
||||
from rest_framework import viewsets
|
||||
# views.py
|
||||
from rest_framework.views import APIView
|
||||
from rest_framework.response import Response
|
||||
from rest_framework import status
|
||||
from rest_framework import generics
|
||||
from django.http import Http404
|
||||
from .models import ObjektSigurnosti
|
||||
from .serializers import ObjektSigurnostiSerializer
|
||||
from django.shortcuts import get_object_or_404
|
||||
|
||||
class ObjektSigurnostiViewSet(viewsets.ModelViewSet):
|
||||
|
||||
|
||||
class ObjektSigurnostiList(generics.ListCreateAPIView):
|
||||
serializer_class = ObjektSigurnostiSerializer
|
||||
|
||||
def get_queryset(self): #queryset je data iz database, listing and creating objects
|
||||
queryset = ObjektSigurnosti.objects.all()
|
||||
location = self.request.query_params.get('lokacija')
|
||||
if location is not None:
|
||||
queryset = queryset.filter(lokacija__icontains=location)
|
||||
return queryset
|
||||
|
||||
# def get_serializer_class(self):
|
||||
# if self.request.method == "GET":
|
||||
# return ObjektSigurnostiSerializer
|
||||
# return self.serializer_class()
|
||||
|
||||
|
||||
class ObjektSigurnostiDetail(generics.RetrieveUpdateDestroyAPIView): #retrieving, updating, and deleting a specific object
|
||||
queryset = ObjektSigurnosti.objects.all()
|
||||
serializer_class = ObjektSigurnostiSerializer
|
||||
|
||||
# def perform_update(self, serializer):
|
||||
# instance = serializer.save()
|
||||
# opis = "Korisnik je uredio objekt sigurnosti {} (ID: {})".format(
|
||||
# instance.vrsta.naziv, instance.id
|
||||
# )
|
||||
# Log.objects.create(user=self.request.user, akcija="Uređivanje", opis=opis)
|
||||
|
||||
# def perform_destroy(self, instance):
|
||||
# super().perform_destroy(instance)
|
||||
# opis = "Korisnik je obrisao objekt sigurnosti {} (ID: {})".format(
|
||||
# instance.vrsta.naziv, instance.id
|
||||
# )
|
||||
# Log.objects.create(user=self.request.user, akcija="Brisanje", opis=opis)
|
||||
|
||||
BIN
plovidba_projekt/__pycache__/env.cpython-38.pyc
Normal file
BIN
plovidba_projekt/__pycache__/env.cpython-38.pyc
Normal file
Binary file not shown.
BIN
plovidba_projekt/__pycache__/router.cpython-38.pyc
Normal file
BIN
plovidba_projekt/__pycache__/router.cpython-38.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
101
plovidba_projekt/env.py
Normal file
101
plovidba_projekt/env.py
Normal file
@ -0,0 +1,101 @@
|
||||
import os
|
||||
|
||||
__all__ = [
|
||||
'BASE_DIR', 'ABS_PATH', 'ENV_BOOL', 'ENV_NUM', 'ENV_STR', 'ENV_LIST', 'PARDIR', 'ENV_TUPLE'
|
||||
]
|
||||
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
PARDIR = os.pardir
|
||||
|
||||
APPLICATION_NAME = "rgi-dev"
|
||||
|
||||
ENV_PATH = os.path.join('/etc/secrets/', APPLICATION_NAME)
|
||||
|
||||
|
||||
def ABS_PATH(*args):
|
||||
return os.path.join(BASE_DIR, *args)
|
||||
|
||||
|
||||
def ENV_BOOL(name, default=False):
|
||||
"""
|
||||
Get a boolean value from environment variable.
|
||||
If the environment variable is not set or value is not one or "true" or
|
||||
"false", the default value is returned instead.
|
||||
"""
|
||||
|
||||
if name not in os.environ:
|
||||
return default
|
||||
if os.environ[name].lower() in ['true', 'yes', '1']:
|
||||
return True
|
||||
elif os.environ[name].lower() in ['false', 'no', '0']:
|
||||
return False
|
||||
else:
|
||||
return default
|
||||
|
||||
|
||||
def ENV_NUM(name, default=None):
|
||||
"""
|
||||
Get a integer value from environment variable.
|
||||
If the environment variable is not set, the default value is returned
|
||||
instead.
|
||||
"""
|
||||
return int(os.environ.get(name, default))
|
||||
|
||||
|
||||
def ENV_STR(name, default=None):
|
||||
"""
|
||||
Get a string value from environment variable.
|
||||
If the environment variable is not set, the default value is returned
|
||||
instead.
|
||||
"""
|
||||
|
||||
return os.environ.get(name, default)
|
||||
|
||||
|
||||
def ENV_LIST(name, separator, default=None):
|
||||
"""
|
||||
Get a list of string values from environment variable.
|
||||
If the environment variable is not set, the default value is returned
|
||||
instead.
|
||||
"""
|
||||
if default is None:
|
||||
default = []
|
||||
|
||||
if name not in os.environ:
|
||||
return default
|
||||
return os.environ[name].split(separator)
|
||||
|
||||
|
||||
def ENV_TUPLE(name, separator, default=None):
|
||||
"""
|
||||
Get a tuple of string values from environment variable.
|
||||
If the environment variable is not set, the default value is returned
|
||||
instead.
|
||||
"""
|
||||
if default is None:
|
||||
default = ()
|
||||
|
||||
if name not in os.environ:
|
||||
return default
|
||||
return tuple(os.environ[name].split(separator))
|
||||
|
||||
|
||||
def _load_env_file():
|
||||
|
||||
if os.path.exists(os.path.join(BASE_DIR, ".env")):
|
||||
envfile = os.path.join(BASE_DIR, ".env")
|
||||
else:
|
||||
envfile = os.path.join(ENV_PATH, ".env")
|
||||
|
||||
if os.path.isfile(envfile):
|
||||
for line in open(envfile):
|
||||
line = line.strip()
|
||||
if not line or line.startswith('#') or '=' not in line:
|
||||
continue
|
||||
k, v = line.split('=', 1)
|
||||
os.environ[k] = v
|
||||
|
||||
|
||||
_load_env_file()
|
||||
@ -17,18 +17,12 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
# dodano
|
||||
import os
|
||||
import GDAL
|
||||
from osgeo import gdal
|
||||
|
||||
from .env import BASE_DIR, ENV_BOOL, ENV_LIST, ENV_NUM, ENV_STR, PARDIR # noqa
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
# use this if setting up on Windows 10 with GDAL installed from OSGeo4W using defaults
|
||||
if os.name == 'nt':
|
||||
VIRTUAL_ENV_BASE = os.environ['VIRTUAL_ENV']
|
||||
os.environ['PATH'] = os.path.join(VIRTUAL_ENV_BASE, r'.\Lib\site-packages\osgeo') + ';' + os.environ['PATH']
|
||||
os.environ['PROJ_LIB'] = os.path.join(VIRTUAL_ENV_BASE, r'.\Lib\site-packages\osgeo\data\proj') + ';' + os.environ['PATH']
|
||||
|
||||
GDAL_LIBRARY_PATH = r'C:\Users\Student1\Desktop\plovidba\myenv\djangoenv\Lib\site-packages\osgeo\gdal304.dll'
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
|
||||
@ -51,8 +45,13 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'django.contrib.gis',
|
||||
'django_extensions',
|
||||
# 3rd party
|
||||
'rest_framework',
|
||||
# Custom apps:
|
||||
'plovidba_aplikacija',
|
||||
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@ -70,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': [
|
||||
@ -123,21 +122,54 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/4.2/topics/i18n/
|
||||
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
LANGUAGE_CODE = 'hr'
|
||||
|
||||
TIME_ZONE = 'UTC'
|
||||
TIME_ZONE = 'Europe/Zagreb'
|
||||
|
||||
USE_I18N = True
|
||||
|
||||
USE_L10N = True
|
||||
|
||||
USE_TZ = True
|
||||
|
||||
LOCALE_PATHS = [os.path.join(BASE_DIR, "locale")]
|
||||
|
||||
PROJ_LIB = ENV_STR("PROJ_LIB", None)
|
||||
GDAL_DATA = ENV_STR("GDAL_DATA", None)
|
||||
|
||||
if PROJ_LIB:
|
||||
os.environ["PROJ_LIB"] = PROJ_LIB
|
||||
|
||||
if GDAL_DATA:
|
||||
os.environ["GDAL_DATA"] = GDAL_DATA
|
||||
|
||||
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/4.2/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
# folder containing static files for production purposes (manage.py collectstatic)
|
||||
STATIC_ROOT = os.path.join(BASE_DIR, "static")
|
||||
|
||||
# static files for each app
|
||||
STATIC_URL = "/api/static/"
|
||||
|
||||
# static files directories for each app
|
||||
#STATICFILES_DIRS = [
|
||||
#os.path.join(BASE_DIR, "user/static"),
|
||||
#]
|
||||
|
||||
# Media Folder
|
||||
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
|
||||
MEDIA_URL = "/api/media/"
|
||||
|
||||
# Resources DIR
|
||||
RESOURCES_DIR = os.path.join(BASE_DIR, "resources")
|
||||
|
||||
# TEMP DIR
|
||||
TEMP_DIR = os.path.join(BASE_DIR, "temp")
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
|
||||
|
||||
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||
|
||||
|
||||
@ -15,8 +15,10 @@ 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 import views
|
||||
|
||||
urlpatterns = [
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
path('api/', include('plovidba_aplikacija.urls')),
|
||||
]
|
||||
1
resources/testnipodaci.json
Normal file
1
resources/testnipodaci.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user