10
10
from django .db import connection
11
11
from django .http import HttpResponseBadRequest
12
12
from django .shortcuts import render_to_response
13
+ from django .views .decorators .csrf import csrf_exempt
13
14
from django .utils import simplejson
14
15
from django .utils .hashcompat import sha_constructor
15
16
@@ -26,6 +27,7 @@ def debug_media(request, path):
26
27
root = os .path .join (parent , 'media' , 'debug_toolbar' )
27
28
return django .views .static .serve (request , path , root )
28
29
30
+ @csrf_exempt
29
31
def sql_select (request ):
30
32
"""
31
33
Returns the output of the SQL SELECT statement.
@@ -58,6 +60,7 @@ def sql_select(request):
58
60
return render_to_response ('debug_toolbar/panels/sql_select.html' , context )
59
61
raise InvalidSQLError ("Only 'select' queries are allowed." )
60
62
63
+ @csrf_exempt
61
64
def sql_explain (request ):
62
65
"""
63
66
Returns the output of the SQL EXPLAIN on the given query.
@@ -98,6 +101,7 @@ def sql_explain(request):
98
101
return render_to_response ('debug_toolbar/panels/sql_explain.html' , context )
99
102
raise InvalidSQLError ("Only 'select' queries are allowed." )
100
103
104
+ @csrf_exempt
101
105
def sql_profile (request ):
102
106
"""
103
107
Returns the output of running the SQL and getting the profiling statistics.
@@ -141,6 +145,7 @@ def sql_profile(request):
141
145
return render_to_response ('debug_toolbar/panels/sql_profile.html' , context )
142
146
raise InvalidSQLError ("Only 'select' queries are allowed." )
143
147
148
+ @csrf_exempt
144
149
def template_source (request ):
145
150
"""
146
151
Return the source of a template, syntax-highlighted by Pygments if
0 commit comments