djangosnippets.org: Latest snippets tagged with 'sql_queries'http://djangosnippets.org/tags/sql_queries/2012-05-15T06:59:30.988572-05:00Debug SQL Query in Template
2012-05-15T06:59:30.988572-05:00dario.agliottonehttp://djangosnippets.org/snippets/2748/<p>before this works, you'll need to satisfy all the criteria for getting debug information in your template context:</p>
<p>Have 'django.core.context_processors.debug' in your TEMPLATE_CONTEXT_PROCESSORS setting (it was there in the default settings, last time I checked).
Have your current IP in your INTERNAL_IPS setting.
Use RequestContext when rendering the current template …</p>
Freely redistributableOutput sql_queries in Firebug console when in debug mode
2010-03-18T13:36:17.173986-05:00wojashttp://djangosnippets.org/snippets/1962/<p>Add this code to the end of the <code><body></code> of your main template and it will print out all your SQL queries with timings in the Firebug console.</p>
<p>This uses the "django.core.context_processors.debug" template context processor, which requires that DEBUG=True and that your IP address is listed in INTERNAL_IPS.</p>
Freely redistributable