Skip to main content

Django Flat JSON Key/Value Widget

Project description

CI build status Requirements Status Chat Pypi Version Downloads code style: black Django Flat JSON (key/value) Widget

If you ever needed to store a flexible dictionary of keys and values in your django models, you may have felt the need of giving your users a widget to easily manipulate the data by adding or removing rows, instead of having to edit the raw JSON.

This package solves exactly that problem: it offers a widget to manipulate a flat JSON object made of simple keys and values.


Tested on python >= 3.7 and Django >= 3.0.

It should work also on previous versions of Django.

Install stable version from pypi

Install from pypi:

pip install django-flat-json-widget


Add flat_json_widget to INSTALLED_APPS:

    # other apps...

Then load the widget where you need it, for example, here’s how to use it in the django admin site:

from django.contrib import admin
from django import forms
from .models import JsonDocument

from flat_json_widget.widgets import FlatJsonWidget

class JsonDocumentForm(forms.ModelForm):
    class Meta:
        widgets = {
            'content': FlatJsonWidget

class JsonDocumentAdmin(admin.ModelAdmin):
    list_display = ['name']
    form = JsonDocumentForm

Installing for development

Install your forked repo:

git clone git://<your_fork>/django-flat-json-widget
cd django-flat-json-widget/
python develop

Install development dependencies:

pip install -e .[test]
npm install -g jslint stylelint

Create database:

cd tests/
./ migrate
./ createsuperuser

Launch development server:

./ runserver

You can access the admin interface at

Run tests with:


Run quality assurance tests with:



Please refer to the OpenWISP contributing guidelines.






See OpenWISP Support Channels.

Project details

Download files

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

Source Distribution

django-flat-json-widget-0.1.2.tar.gz (16.3 kB view hashes)

Uploaded Source

Built Distribution

django_flat_json_widget-0.1.2-py2.py3-none-any.whl (16.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page