Which is the most reliable way to detect N+1 queries during development?
- A Reading the code carefully
- B Using django-debug-toolbar to inspect the query count per page
- C Checking the server logs
- D Increasing the database timeout
Answer
Using django-debug-toolbar to inspect the query count per page
The toolbar shows every query and its origin. Adding assertNumQueries to a test then prevents the problem from returning.





