Output sql_queries in Firebug console when in debug mode

1
2
3
4
5
6
7
{% if debug %}
<script type="text/javascript">
  {% for q in sql_queries %}
    console.debug("({{ q.time }}s)", "{{ q.sql|escapejs }}");
  {% endfor %}
</script> 
{% endif %}

More like this

  1. Debug SQL Query in Template by dario.agliottone 1 year, 1 month ago
  2. Template Query Debug by insin 6 years, 3 months ago
  3. SQL Log To Console Middleware by davepeck 3 years, 10 months ago
  4. Middleware for printing of exception to console by dballanc 5 years, 9 months ago
  5. Context processor for django admin app_list by alexander 3 years, 4 months ago

Comments

(Forgotten your password?)