debug()
[source]
If this processor is enabled, every RequestContext
will contain these two variables – but only if your DEBUG
setting is set to True
and the request’s IP address (request.META['REMOTE_ADDR']
) is in the INTERNAL_IPS
setting:
-
debug
–True
. You can use this in templates to test whether you’re inDEBUG
mode. -
sql_queries
– A list of{'sql': ..., 'time': ...}
dictionaries, representing every SQL query that has happened so far during the request and how long it took. The list is in order by database alias and then by query. It’s lazily generated on access.
Changed in Django 1.10:
In older versions, only the queries for the default database alias were included.
Please login to continue.