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
8d0cc100
Commit
8d0cc100
authored
Sep 21, 2012
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a debug_request view that prints the request.
parent
a4d4a3b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
common/djangoapps/util/views.py
+5
-0
lms/urls.py
+4
-0
No files found.
common/djangoapps/util/views.py
View file @
8d0cc100
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
)))
lms/urls.py
View file @
8d0cc100
...
...
@@ -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'
),
...
...
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