This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

JSON prettyprinter WSGI middleware

Handy for viewing JSON payloads which would otherwise be downloaded by your web browser (due to the Content-Type response header being set to an unrecognized type like “application/json”).

If a special query parameter (by default “pj”, short for “Print JSON”) is found in the query string, assume the response body contains JSON data which should be “printed” to the response by setting the response Content-Type to “text/plain”.

Example usage:

If the parameter has a positive integer value, prettyprint the JSON (sort the keys and treat the parm value as an indent value).

Example usage:

Note that the parameter is removed from the request query string before the middleware invokes the wrapped application.


If using Paster, edit your .ini file and add a new filter section:

use = egg:print_json_middleware#print_json

Then find the application section (typically under the header [app:main]) and add:

filter-with = print_json

If you’d rather use some other parameter name than “pj”, specify it in the [filter:print_json] section:

parm = whatever

As an alternative to Paster configuration, you could do the application wrapping in Python code:

from print_json_middleware import PrintJsonMiddleware
application = PrintJsonMiddleware(application)

If you’d rather use some other parameter name than “pj”, pass it as a second argument:

application = PrintJsonMiddleware(application, "whatever")
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
print_json_middleware-0.1.1.tar.gz (3.4 kB) Copy SHA256 Checksum SHA256 Source Mar 21, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting