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