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:¶
# oapif.py
from .models import TestModel
from django_oapif import OAPIF
oapif = OAPIF()
oapif.register_collection(TestModel)
oapif.register_collection(OtherTestModel)