Skip to main content

Django json widget is an alternative widget that makes it easy to edit the jsonfield field of django.

Project description

An alternative widget that makes it easy to edit the new Django’s field JSONField (PostgreSQL specific model fields)


Install django-json-widget:

pip install django-json-widget

Add it to your INSTALLED_APPS:


Add the widget in your

from django.contrib import admin
# from django.contrib.postgres import fields # if django < 3.1
from django.db import models
from django_json_widget.widgets import JSONEditorWidget
from .models import YourModel

class YourModelAdmin(admin.ModelAdmin):
    formfield_overrides = {
        # fields.JSONField: {'widget': JSONEditorWidget}, # if django < 3.1
        models.JSONField: {'widget': JSONEditorWidget},

You can also add the widget in your

from django import forms
from django_json_widget.widgets import JSONEditorWidget
from .models import YourModel

class YourForm(forms.ModelForm):
    class Meta:
        model = YourModel

        fields = ('jsonfield',)

        widgets = {
            'jsonfield': JSONEditorWidget


You can customize the JSONEditorWidget with the following options:

  • width: Width of the editor as a string with CSS size units (px, em, % etc). Defaults to 90%.
  • height: Height of the editor as a string CSS size units. Defaults to 550px.
  • options: A dict of options accepted by the JSON editor. Options that require functions (eg. onError) are not supported.
  • mode (deprecated): The default editor mode. This argument is redundant because it can be specified as a part of options. Preserved for backwards compatibility with version 0.2.0.
  • attrs: HTML attributes to be applied to the wrapper element. See the Django Widget documentation.

JSONEditorWidget widget




Tools used in rendering this package:


0.1.0 (2017-05-10)

  • First release on PyPI.

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-json-widget, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size django-json-widget-1.1.1.tar.gz (249.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page