Django Debug Toolbar

In the django debug toolbar, SQL section do not display any data ; simply put it says
“No SQL queries were recorded during this request.” , unless I write a print statement in my code.


OR in template like->

Is it a normal behavior? Or I am doing something wrong.

Do I have to actually write some sort of print statement in order for the SQL section(in debug toolbar) to work ?

Django by default implements lazy loading. If your views aren’t returning querysets, then SQL queries are never made.

Lazy loading means that until you perform certain actions on the queryset, such as iterating over it, the corresponding DB query won’t be made.

1 Like

Really appreciate it