diff --git a/common/djangoapps/util/views.py b/common/djangoapps/util/views.py index e38056934f..8b9dd5a9c1 100644 --- a/common/djangoapps/util/views.py +++ b/common/djangoapps/util/views.py @@ -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("
{0}
".format(pprint.pformat(request))) diff --git a/lms/urls.py b/lms/urls.py index a989767d76..8245a42f04 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -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[^/]*)$', 'student.views.confirm_email_change'), url(r'^change_name$', 'student.views.change_name_request'),