skillfed

django-prettyjson

Enables pretty JSON viewer in Django forms, admin, or templates

django-prettyjson v0.4.1 178.8K downloads/30d#10,186 on PyPI143
Permissive license BSD AGING released

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-prettyjson

uv

uv add django-prettyjson

poetry

poetry add django-prettyjson

Installing 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

Development Status :: 3 - AlphaFramework :: DjangoFramework :: Django :: 1.8Framework :: Django :: 1.9Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5

Tags

django json viewer widgetpretty json display djangojson form field visualizationdjango admin json viewercollapsible json rendererdjango template json displayjson syntax highlighting django
django-adminjson-viewerui-widget

More Dynamic Content packages