Skip to main content

Compatability layer between django-jsonfield and Django's native JSONField

Project description


![Travis Build Status](
[![Coverage Status](](

Django 1.9 introduced first-class support for Postgresql's json type.

Not everyone uses Postgresql, nor has upgraded to 1.9 yet, so a mixed ecosystem exists.
Unfortunately, these two field types cannot be used together in the same project.

django-jsonfield-compat was created to be able to allow 3rd-party libraries to work in both worlds.

Requires Django >= 1.8


`pip install django-jsonfield-compat`

Adjust all instances of importing `JSONField` and `JSONFormField` to `jsonfield_compat`'s definition (including all migration files!)

from jsonfield_compat import JSONField
from jsonfield_compat.forms import JSONFormField

Register your app from the AppConfig class's `ready()` function.

Example ``:

from __future__ import unicode_literals

from django.apps import AppConfig

class MyAppConfig(AppConfig):
name = 'myapp'
verbose_name = "My App"

def ready(self):
import jsonfield_compat

Now, when users of your application want to switch from using `django-jsonfield`'s implementation
to Django's native `JSONField`, they add the setting:


And then run migrations to convert the app's DB tables to use the JSON column type.


django-jsonfield-compat is licensed under the MIT license (see the `LICENSE` file for details).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-jsonfield-compat, version 0.4.4
Filename, size File type Python version Upload date Hashes
Filename, size django_jsonfield_compat-0.4.4-py2.py3-none-any.whl (6.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-jsonfield-compat-0.4.4.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page