add a debug_request view that prints the request.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import datetime
|
||||
import json
|
||||
import pprint
|
||||
import sys
|
||||
|
||||
from django.conf import settings
|
||||
@@ -91,3 +92,7 @@ def accepts(request, media_type):
|
||||
"""Return whether this request has an Accept header that matches type"""
|
||||
accept = parse_accept_header(request.META.get("HTTP_ACCEPT", ""))
|
||||
return media_type in [t for (t, p, q) in accept]
|
||||
|
||||
def debug_request(request):
|
||||
"""Return a pretty printed version of the request"""
|
||||
return HttpResponse("<html><pre>{0}</pre></html>".format(pprint.pformat(request)))
|
||||
|
||||
@@ -15,6 +15,10 @@ urlpatterns = ('',
|
||||
|
||||
url(r'^admin_dashboard$', 'dashboard.views.dashboard'),
|
||||
|
||||
# Adding to allow debugging issues when prod is mysteriously different from staging
|
||||
# (specifically missing get parameters in certain cases)
|
||||
url(r'^debug_request$', 'util.views.debug_request'),
|
||||
|
||||
url(r'^change_email$', 'student.views.change_email_request'),
|
||||
url(r'^email_confirm/(?P<key>[^/]*)$', 'student.views.confirm_email_change'),
|
||||
url(r'^change_name$', 'student.views.change_name_request'),
|
||||
|
||||
Reference in New Issue
Block a user