0

I want to use Django debug toolbar with Angular.js to see SQL queries, time taken to execute and explanation. I have added Django debug toolbar in the INSTALLED_APPS.

According to documentation I set ROOT_TAG_EXTRA_ATTRS = 'ng-non-bindable' in the settings.py file. And even tried ROOT_TAG_EXTRA_ATTRS = 'class="ng-non-bindable"'

I see 0 SQL query even though queries are made and data is received successfully.

What's the catch here?

MysticCodes
  • 3,092
  • 5
  • 25
  • 33

1 Answers1

1

It probably didn't work because ROOT_TAG_EXTRA_ATTRS should be set not directly in settings but within DEBUG_TOOLBAR_CONFIG dictionary:

DEBUG_TOOLBAR_CONFIG = {
    'ROOT_TAG_EXTRA_ATTRS' : 'ng-non-bindable'
}

Update: chances are that with angular sql queries will still be not visible because django-debug-toolbar does not support ajax calls. This question might help - there is an answer referring to a Django app django-admin-panel and an associated Chrome extension that shoud support ajax calls. But the problem is that it looks like this project is not supported and I haven't been able to make it work with latest versions of Django and django-admin-toolbar yet.

Community
  • 1
  • 1
Andrey Grachev
  • 1,259
  • 1
  • 14
  • 22