|
1 | 1 | from __future__ import absolute_import, unicode_literals
|
2 | 2 |
|
3 | 3 | from django.http import HttpResponseBadRequest
|
4 |
| -from django.shortcuts import render_to_response |
| 4 | +from django.template.response import SimpleTemplateResponse |
5 | 5 | from django.views.decorators.csrf import csrf_exempt
|
6 | 6 |
|
7 | 7 | from debug_toolbar.decorators import require_show_toolbar
|
@@ -29,8 +29,8 @@ def sql_select(request):
|
29 | 29 | 'headers': headers,
|
30 | 30 | 'alias': form.cleaned_data['alias'],
|
31 | 31 | }
|
32 |
| - # Using render_to_response avoids running global context processors. |
33 |
| - return render_to_response('debug_toolbar/panels/sql_select.html', context) |
| 32 | + # Using SimpleTemplateResponse avoids running global context processors. |
| 33 | + return SimpleTemplateResponse('debug_toolbar/panels/sql_select.html', context) |
34 | 34 | return HttpResponseBadRequest('Form errors')
|
35 | 35 |
|
36 | 36 |
|
@@ -66,8 +66,8 @@ def sql_explain(request):
|
66 | 66 | 'headers': headers,
|
67 | 67 | 'alias': form.cleaned_data['alias'],
|
68 | 68 | }
|
69 |
| - # Using render_to_response avoids running global context processors. |
70 |
| - return render_to_response('debug_toolbar/panels/sql_explain.html', context) |
| 69 | + # Using SimpleTemplateResponse avoids running global context processors. |
| 70 | + return SimpleTemplateResponse('debug_toolbar/panels/sql_explain.html', context) |
71 | 71 | return HttpResponseBadRequest('Form errors')
|
72 | 72 |
|
73 | 73 |
|
@@ -113,6 +113,6 @@ def sql_profile(request):
|
113 | 113 | 'headers': headers,
|
114 | 114 | 'alias': form.cleaned_data['alias'],
|
115 | 115 | }
|
116 |
| - # Using render_to_response avoids running global context processors. |
117 |
| - return render_to_response('debug_toolbar/panels/sql_profile.html', context) |
| 116 | + # Using SimpleTemplateResponse avoids running global context processors. |
| 117 | + return SimpleTemplateResponse('debug_toolbar/panels/sql_profile.html', context) |
118 | 118 | return HttpResponseBadRequest('Form errors')
|
0 commit comments