django-prettyjson
Enables pretty JSON viewer in Django forms, admin, or templates
What it is and what it does
django-prettyjson is a Django app that wraps JSON data in an interactive, collapsible viewer for use in forms, admin pages, and templates. It adapts jQuery JSONView to render JSON with syntax highlighting and tree-style navigation, letting users expand and collapse nested objects and arrays. The viewer works with JSON strings, Django's JSONField (from both django.contrib.postgres and the third-party django-jsonfield package), and any Python object serializable to JSON.
You install it as a Django app, then use the PrettyJSONWidget in your form or admin class, or call the prettyjson template tag in your templates. The widget can render JSON as raw text with a toggle button, or as parsed JSON by default. It includes jQuery (namespaced to avoid conflicts) and CSS for styling, though you can disable jQuery loading if your page already includes it.
Use it for:
- Display JSON data in Django admin for models storing JSON fields, making it easier to inspect nested structures.
- Render API response payloads or configuration objects as collapsible trees in forms or detail pages.
- Visualize QuerySets or Python dicts as JSON in templates without writing custom JavaScript.
- Allow end users to review and edit JSON data in admin forms with visual structure guidance.
- Debug and inspect complex JSON documents in development by toggling between raw and parsed views.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds a collapsible, interactive JSON viewer widget to Django forms, admin interfaces, and templates, rendering JSON data with syntax highlighting and expandable tree navigation.
No, not for new projects. The package has no known vulnerabilities and low install friction, but it has not been updated since 2018 and declares support only for Django 1.8–1.9 and Python 2.7, 3.4–3.5—all out of support. While the core functionality may still work on modern Django, there is no maintenance signal, no test confirmation, and no indication the author is actively supporting it. For modern Django projects, consider alternatives or fork and update this package yourself if you need this specific widget.
Install
django-prettyjson on PyPI
pip
pip install django-prettyjsonuv
uv add django-prettyjsonpoetry
poetry add django-prettyjsonInstalling django-prettyjson
Before you install
Low install friction with no runtime dependencies. The package is aging—last release was 2018-08-07 and the repository shows no recent activity despite being unarchived. Classifiers indicate support for Django 1.8–1.9 and Python 2.7, 3.4–3.5, which are well out of support.
License in practice
Licensed under BSD (permissive), so you can use, modify, and distribute the package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install django-prettyjson
# In settings.py
INSTALLED_APPS = [
...,
'prettyjson',
]
# In a form or admin
from prettyjson import PrettyJSONWidget
from django import forms
class MyForm(forms.ModelForm):
class Meta:
widgets = {'json_field': PrettyJSONWidget()}
Requires Django to be installed and configured; the package's stated support is for Django 1.8–1.9, which are no longer maintained.
Verify before relying
- Whether the package works with modern Django versions (3.x, 4.x, 5.x) despite classifiers listing only 1.8–1.9.
- Whether the jQuery JSONView adapter it uses remains compatible with current browser standards and jQuery versions.
- Current test coverage and whether tests pass on modern Python and Django versions.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 2,929 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 178,818/month — #10,186 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_prettyjson-0.4.1-py2.py3-none-any.whl
Keywords: django-prettyjson
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
django-json-widgetProvides a rich JSON editor widget for Django's…
permissive · top 5,000 on PyPI
django-jsonformProvides a user-friendly JSON editing form…
permissive · top 15,000 on PyPI
django-jsoneditorProvides a Django form widget for editing JSON…
unclear · top 15,000 on PyPI
django-map-widgetsProvides interactive and static map widgets for…
permissive · top 15,000 on PyPI
django-jsonfieldProvides a JSONField for Django models that…
permissive · top 15,000 on PyPI
django-better-admin-arrayfieldProvides a list-based widget for Django's…
permissive · top 15,000 on PyPI
django-admin-autocomplete-filterAdds autocomplete-based filtering to Django…
copyleft · top 15,000 on PyPI
django-aceIntegrates the ACE code editor into Django…
permissive · top 15,000 on PyPI
django-summernoteEmbeds the Summernote WYSIWYG editor into…
permissive · top 15,000 on PyPI