Add a view that can show us what URL params we got

This commit is contained in:
Ned Batchelder
2014-07-22 11:24:53 -04:00
committed by Anurag Ramdasan
parent f77c06ff1f
commit d9bb2868e8
2 changed files with 17 additions and 0 deletions

View File

@@ -10,6 +10,9 @@ from edxmako.shortcuts import render_to_response
from codejail.safe_exec import safe_exec
from util.json_request import JsonResponse
@login_required
@ensure_csrf_cookie
def run_python(request):
@@ -29,3 +32,13 @@ def run_python(request):
else:
c['results'] = pprint.pformat(g)
return render_to_response("debug/run_python_form.html", c)
@login_required
def show_parameters(request):
"""A page that shows what GET parameters were on the URL."""
params = {
'get': dict(request.GET),
'post': dict(request.POST),
}
return JsonResponse(params)

View File

@@ -481,6 +481,10 @@ if settings.FEATURES.get('ENABLE_DEBUG_RUN_PYTHON'):
url(r'^debug/run_python', 'debug.views.run_python'),
)
urlpatterns += (
url(r'^debug/show_parameters', 'debug.views.show_parameters'),
)
# Crowdsourced hinting instructor manager.
if settings.FEATURES.get('ENABLE_HINTER_INSTRUCTOR_VIEW'):
urlpatterns += (