
import json
import webob.dec


@webob.dec.wsgify
def echo_app(request):
    """A WSGI application that echoes the CGI environment to the user."""
    return webob.Response(content_type='application/json',
                          body=json.dumps(request.environ, indent=4))


def echo_app_factory(global_conf, **local_conf):
    import ipdb; ipdb.set_trace()
    return echo_app


import pprint
import webob.dec


@webob.dec.wsgify
def echo_app(request):
    """A WSGI application that echoes the CGI environment to the user."""
    return webob.Response(content_type='application/json',
                          body=pprint.pformat(request.environ, indent=4))


def echo_app_factory(global_conf, **local_conf):
    return echo_app

Use pprint instead of json for formatting
Use pprint instead of json for formatting

json.dumps fails to print anything for an object. I would prefer to show
a representation of the object rather than filter it out so rely on
pprint instead.

  
- import json
+ import pprint
  import webob.dec
  
  
  @webob.dec.wsgify
  def echo_app(request):
      """A WSGI application that echoes the CGI environment to the user."""
      return webob.Response(content_type='application/json',
-                           body=json.dumps(request.environ, indent=4))
+                           body=pprint.pformat(request.environ, indent=4))
  
  
  def echo_app_factory(global_conf, **local_conf):
-     import ipdb; ipdb.set_trace()
      return echo_app
  
Use pprint instead of json for formatting
## Code Before:

import json
import webob.dec


@webob.dec.wsgify
def echo_app(request):
    """A WSGI application that echoes the CGI environment to the user."""
    return webob.Response(content_type='application/json',
                          body=json.dumps(request.environ, indent=4))


def echo_app_factory(global_conf, **local_conf):
    import ipdb; ipdb.set_trace()
    return echo_app

## Instruction:
Use pprint instead of json for formatting
## Code After:

import pprint
import webob.dec


@webob.dec.wsgify
def echo_app(request):
    """A WSGI application that echoes the CGI environment to the user."""
    return webob.Response(content_type='application/json',
                          body=pprint.pformat(request.environ, indent=4))


def echo_app_factory(global_conf, **local_conf):
    return echo_app
