Commit 31febfa2 by Victor Shnayder

Merge pull request #754 from MITx/feature/victor/add-request-debug-view

Add more info to debug view
parents 01f42ff2 432294a1
...@@ -95,4 +95,27 @@ def accepts(request, media_type): ...@@ -95,4 +95,27 @@ def accepts(request, media_type):
def debug_request(request): def debug_request(request):
"""Return a pretty printed version of the request""" """Return a pretty printed version of the request"""
return HttpResponse("<html><pre>{0}</pre></html>".format(pprint.pformat(request)))
return HttpResponse("""<html>
<h1>request:</h1>
<pre>{0}</pre>
<h1>request.GET</h1>:
<pre>{1}</pre>
<h1>request.POST</h1>:
<pre>{2}</pre>
<h1>request.REQUEST</h1>:
<pre>{3}</pre>
</html>
""".format(
pprint.pformat(request),
pprint.pformat(dict(request.GET)),
pprint.pformat(dict(request.POST)),
pprint.pformat(dict(request.REQUEST)),
))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment