2

Previous Django apps I've worked on have used HTML template rendering, and django-debug-toolbar has proven to be a valuable way to analyze ORM SQL queries and find places to optimize.

The current app I'm working on uses Django for django-rest-framework REST endpoints only, and has no HTML views.

Is there a way I can analyze queries in a similar way? I looked into django-debug-toolbar + django-debug-panel (with a Chrome extension), but it's quite a bit out of date, requiring Django 2.1 or earlier.

Glenn Barnett
  • 2,031
  • 1
  • 21
  • 31

2 Answers2

1

I am not sure about django-debug-toolbar for API testing, because request are made with AJAx in swagger UI and other browsable tool API.

But you can look Django-silk with is more usable for your case with same information of Django-Debug-Toolbar: https://github.com/jazzband/django-silk

Hope this can help

Lucas Grugru
  • 1,664
  • 1
  • 4
  • 18
1

You can try dj-tracker. It will keep track of all your queries (and can even give hints to optimize them).