Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
533e0726
Commit
533e0726
authored
Jul 23, 2014
by
Ned Batchelder
Committed by
Anurag Ramdasan
Jul 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A debug view for seeing the URL params
parent
412e6d34
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
lms/djangoapps/debug/views.py
+10
-9
lms/urls.py
+2
-2
No files found.
lms/djangoapps/debug/views.py
View file @
533e0726
...
...
@@ -3,15 +3,15 @@
import
pprint
import
traceback
from
django.http
import
Http404
from
django.http
import
Http404
,
HttpResponse
from
django.contrib.auth.decorators
import
login_required
from
django.utils.html
import
escape
from
django_future.csrf
import
ensure_csrf_cookie
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
...
...
@@ -36,9 +36,10 @@ def run_python(request):
@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
)
"""A page that shows what parameters were on the URL and post."""
html
=
[]
for
name
,
value
in
sorted
(
request
.
GET
.
items
()):
html
.
append
(
escape
(
"GET {}: {!r}"
.
format
(
name
,
value
)))
for
name
,
value
in
sorted
(
request
.
POST
.
items
()):
html
.
append
(
escape
(
"POST {}: {!r}"
.
format
(
name
,
value
)))
return
HttpResponse
(
"
\n
"
.
join
(
"<p>{}</p>"
.
format
(
h
)
for
h
in
html
))
lms/urls.py
View file @
533e0726
...
...
@@ -478,11 +478,11 @@ urlpatterns += (
if
settings
.
FEATURES
.
get
(
'ENABLE_DEBUG_RUN_PYTHON'
):
urlpatterns
+=
(
url
(
r'^debug/run_python'
,
'debug.views.run_python'
),
url
(
r'^debug/run_python
$
'
,
'debug.views.run_python'
),
)
urlpatterns
+=
(
url
(
r'^debug/show_parameters'
,
'debug.views.show_parameters'
),
url
(
r'^debug/show_parameters
$
'
,
'debug.views.show_parameters'
),
)
# Crowdsourced hinting instructor manager.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment