Ticket #5225: debug.patch
File debug.patch, 1.9 KB (added by , 17 years ago) |
---|
-
data/django/django/views/debug.py
3 3 from django.utils.html import escape 4 4 from django.http import HttpResponseServerError, HttpResponseNotFound 5 5 from django.utils.encoding import smart_unicode 6 from django.db import connection 6 7 import os, re, sys 7 8 8 9 HIDDEN_SETTINGS = re.compile('SECRET|PASSWORD|PROFANITIES_LIST') … … 147 148 'template_info': template_info, 148 149 'template_does_not_exist': template_does_not_exist, 149 150 'loader_debug_info': loader_debug_info, 151 'queries':connection.queries 150 152 }) 151 153 return HttpResponseServerError(t.render(c), mimetype='text/html') 152 154 … … 170 172 'request': request, 171 173 'request_protocol': request.is_secure() and "https" or "http", 172 174 'settings': get_safe_settings(), 175 'queries':connection.queries 173 176 }) 174 177 return HttpResponseNotFound(t.render(c), mimetype='text/html') 175 178 … … 585 588 </tbody> 586 589 </table> 587 590 591 <h3 id="query-info">Queries</h3> 592 {% if queries %} 593 <table class="req"> 594 <thead> 595 <tr> 596 <th>Time</th> 597 <th>Sql</th> 598 </tr> 599 </thead> 600 <tbody> 601 {% for query in queries %} 602 <tr> 603 <td>{{ query.time }}</td> 604 <td class="code"><div>{{ query.sql }}</div></td> 605 </tr> 606 {% endfor %} 607 </tbody> 608 </table> 609 {% else %} 610 <p>No query data</p> 611 {% endif %} 612 588 613 </div> 589 614 590 615 <div id="explanation"> … … 653 678 {% else %} 654 679 <p>{{ reason|escape }}</p> 655 680 {% endif %} 681 {% if queries %} 682 <p align="center">***</p> 683 <h3>Queries</h3> 684 {% for query in queries %} 685 <p>{{ query.sql }}</p> 686 {% endfor %} 687 {% endif %} 656 688 </div> 657 689 658 690 <div id="explanation">