[Answered ]-Django Serialize a JsonField, Django Rest API

1👍

You use a form field in your model, not Django’s JSONField model field [Django-doc]. It should be:

#         models 🖟
from django.db.models import JSONField

class Area(models.model):
    geojson = JSONField()

You however might be interested to work with a spatial field type [Django-doc], and take a look at django-geojson [GitHub] for GeoJSON functionality.

Leave a comment