Django-JSONEditor is an online structured JSON input widget for Django that enhances the editing experience for various JSONField implementations. It integrates the core JSONEditor JavaScript library (from jsoneditoronline.org) into Django's admin interface and forms. The library is currently at version 0.2.4, with its last release in February 2023, and shows an active but somewhat dated approach to JSON editing within the Django ecosystem, with discussions around newer alternatives.
pip install django-jsoneditorVerified import paths — ran on the pinned version, not inferred.
To quickly integrate `django-jsoneditor` into your Django admin, add `jsoneditor` to your `INSTALLED_APPS` and then override the default widget for `JSONField` in your `admin.py` using `formfield_overrides`. Ensure you have an appropriate `JSONField` defined in your model, such as `django.db.models.JSONField` (for Django 3.1+ or with PostgreSQL) or a compatible third-party `JSONField`.
Ensure your model's JSON field is defined using `django.db.models.JSONField` or a compatible alternative like `django-jsonfield`.
For basic use cases, this may not be an issue. For highly interactive, large-document, or modern UI needs, consider evaluating `django-svelte-jsoneditor` or other alternatives.
Refer to the GitHub README's 'Custom JSONEditor initialization' section for detailed steps on setting `JSON_EDITOR_INIT_JS` and modifying the `init.js` file.