{"id":19940714,"url":"https://github.com/arthurc0102/django-jsoneditor-widget","last_synced_at":"2025-06-30T10:05:32.861Z","repository":{"id":57420548,"uuid":"144927662","full_name":"arthurc0102/django-jsoneditor-widget","owner":"arthurc0102","description":"Django form widget form JSONField","archived":false,"fork":false,"pushed_at":"2021-01-03T13:36:14.000Z","size":1197,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-25T02:19:26.041Z","etag":null,"topics":["django","json","widget"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arthurc0102.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-16T02:43:19.000Z","updated_at":"2022-11-14T12:15:10.000Z","dependencies_parsed_at":"2022-09-16T09:21:18.291Z","dependency_job_id":null,"html_url":"https://github.com/arthurc0102/django-jsoneditor-widget","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/arthurc0102/django-jsoneditor-widget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurc0102%2Fdjango-jsoneditor-widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurc0102%2Fdjango-jsoneditor-widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurc0102%2Fdjango-jsoneditor-widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurc0102%2Fdjango-jsoneditor-widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthurc0102","download_url":"https://codeload.github.com/arthurc0102/django-jsoneditor-widget/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurc0102%2Fdjango-jsoneditor-widget/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261859285,"owners_count":23220718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","json","widget"],"created_at":"2024-11-13T00:06:33.835Z","updated_at":"2025-06-30T10:05:32.838Z","avatar_url":"https://github.com/arthurc0102.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-jsoneditor-widget\n\n\u003e Django form widget form JSONField\n\n## Demo\n\nIt look like this.\n\n![demo image](https://github.com/arthurc0102/django-jsoneditor-widget/blob/master/screenshot/demo.png?raw=true)\n\n## Install\n\n- Install: `pip install django-jsoneditor-widget`\n- Settings:\n    ```python\n    INSTALLED_APPS = [\n        # some apps ....\n        'jsoneditor',\n        # other apps ...\n    ]\n    ```\n\n## Create model\n\n```python\nfrom django.db import models\nfrom django.contrib.postgres.fields import JSONField\n\n\nclass Book(models.Model):\n    name = models.CharField(max_length=150)\n    information = JSONField()\n\n    def __str__(self):\n        return self.name\n```\n\n## Admin site settings\n\n- Use ModelAdmin\n    ```python\n    from django.contrib import admin\n\n    from jsoneditor.admin import JSONFieldModelAdmin\n\n    from .models import Book\n\n\n    admin.site.register(Product, JSONFieldModelAdmin)\n    ```\n\n- Use mixin\n    ```python\n    from django.contrib import admin\n    \n    from jsoneditor.admin import JSONFieldAdminMixin\n\n    from .models import Book\n\n\n    @admin.register(Book)\n    class BookModelAdmin(JSONFieldAdminMixin, admin.ModelAdmin):\n        pass\n    ```\n\n- Use custom widget to specify jsoneditor options\n    ```python\n    from django.contrib import admin\n    from django.contrib.postgres.fields import JSONField\n\n    from jsoneditor.forms import JSONEditor\n\n    from .models import Book\n\n\n    class TextJSONEditor(JSONEditor):\n        jsoneditor_options = {\n            \"mode\": \"text\"\n        }\n\n\n    @admin.register(Book)\n    class BookModelAdmin(admin.ModelAdmin):\n        formfield_overrides = {\n            JSONField: {\"widget\": TextJSONEditor}\n        }\n\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurc0102%2Fdjango-jsoneditor-widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurc0102%2Fdjango-jsoneditor-widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurc0102%2Fdjango-jsoneditor-widget/lists"}