Fix for https://github.com/django-debug-toolbar/django-debug-toolbar/issues/334