Login

Tag "sql_queries"

Snippet List

Debug SQL Query in Template

before this works, you'll need to satisfy all the criteria for getting debug information in your template context: 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 (if you're using a generic view, you're already using RequestContext). [Manuale Django](http://www.darioagliottone.it/django-guida/)

  • sql
  • template
  • debug
  • debugging
  • sql_queries
Read More

Output sql_queries in Firebug console when in debug mode

Add this code to the end of the `<body>` of your main template and it will print out all your SQL queries with timings in the Firebug console. 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.

  • sql
  • debug
  • console
  • firebug
  • sql_queries
Read More

2 snippets posted so far.