Django JSONField

3.2.0 · deprecated · verified Sun Apr 12

A reusable Django model field that allows you to store validated JSON, automatically handling serialization to and from the database. The package is currently at version 3.2.0. This package is in maintenance mode and is considered deprecated in favor of Django's native JSONField (introduced in Django 3.1) which offers superior database-agnostic support and querying capabilities.

Warnings

Install

Imports

Quickstart

Define a model with `jsonfield.JSONField`. It's recommended to use a callable for mutable defaults (like `dict` or `list`) to avoid shared state issues.

from django.db import models
from jsonfield import JSONField

class MyModel(models.Model):
    name = models.CharField(max_length=100)
    data = JSONField(default=dict) # Use a callable for mutable defaults

# Example usage:
# obj = MyModel.objects.create(name='Example', data={'key': 'value', 'number': 123})
# print(obj.data['key'])

view raw JSON →