Quickstart¶
Installation¶
Install with your favorite package manager
Enable the app¶
Edit settings.py
Declare your models:¶
# models.py
from django.contrib.gis.db import models
class TestModel(models.Model):
name = models.CharField(max_length=10)
geom = models.PointField(srid=2056)
class OtherTestModel(models.Model):
id = models.CharField(max_length=10)
geom = models.PolygonField(srid=2056)
Instantiate OAPIF and register your models:¶
# ogc.py
from .models import TestModel
from django_oapif import OAPIF
ogc_api = OAPIF()
@ogc_api.register(TestModel)
@ogc_api.register(OtherTestModel)