Bläddra i källkod

HUE-3287 [core] Django 1.11 upgrade
- Upgrading django-debug-toolbar from 1.3.2 to 1.9.1

Prakash Ranade 7 år sedan
förälder
incheckning
8387d83741
100 ändrade filer med 1228 tillägg och 1232 borttagningar
  1. 0 36
      desktop/core/ext-py/django-debug-toolbar-1.3.2/README.rst
  2. 0 16
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/apps.py
  3. 0 114
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/compat.py
  4. BIN
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/ru/LC_MESSAGES/django.mo
  5. 0 9
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/models.py
  6. 0 1
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/sql/__init__.py
  7. 0 227
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/templates/panel.py
  8. 0 55
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/templates/views.py
  9. 0 71
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/versions.py
  10. 0 232
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/settings.py
  11. 0 1
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/js/jquery_post.js
  12. 0 1
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/js/jquery_pre.js
  13. 0 22
      desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/templatetags/debug_toolbar_compat.py
  14. 0 12
      desktop/core/ext-py/django-debug-toolbar-1.3.2/setup.cfg
  15. 7 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/CONTRIBUTING.md
  16. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/LICENSE
  17. 1 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/MANIFEST.in
  18. 28 14
      desktop/core/ext-py/django-debug-toolbar-1.9.1/PKG-INFO
  19. 45 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/README.rst
  20. 5 3
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/__init__.py
  21. 71 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/apps.py
  22. 11 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/compat.py
  23. 16 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/decorators.py
  24. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/ca/LC_MESSAGES/django.mo
  25. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/ca/LC_MESSAGES/django.po
  26. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/cs/LC_MESSAGES/django.mo
  27. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/cs/LC_MESSAGES/django.po
  28. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/de/LC_MESSAGES/django.mo
  29. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/de/LC_MESSAGES/django.po
  30. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/en/LC_MESSAGES/django.mo
  31. 23 13
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/en/LC_MESSAGES/django.po
  32. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/es/LC_MESSAGES/django.mo
  33. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/es/LC_MESSAGES/django.po
  34. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/fi/LC_MESSAGES/django.mo
  35. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/fi/LC_MESSAGES/django.po
  36. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/fr/LC_MESSAGES/django.mo
  37. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/fr/LC_MESSAGES/django.po
  38. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/he/LC_MESSAGES/django.mo
  39. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/he/LC_MESSAGES/django.po
  40. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/id/LC_MESSAGES/django.mo
  41. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/id/LC_MESSAGES/django.po
  42. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/it/LC_MESSAGES/django.mo
  43. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/it/LC_MESSAGES/django.po
  44. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/nl/LC_MESSAGES/django.mo
  45. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/nl/LC_MESSAGES/django.po
  46. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pl/LC_MESSAGES/django.mo
  47. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pl/LC_MESSAGES/django.po
  48. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pt/LC_MESSAGES/django.mo
  49. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pt/LC_MESSAGES/django.po
  50. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.mo
  51. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.po
  52. BIN
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/ru/LC_MESSAGES/django.mo
  53. 209 186
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/ru/LC_MESSAGES/django.po
  54. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/sk/LC_MESSAGES/django.mo
  55. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/sk/LC_MESSAGES/django.po
  56. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.mo
  57. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.po
  58. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/uk/LC_MESSAGES/django.mo
  59. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/uk/LC_MESSAGES/django.po
  60. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.mo
  61. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.po
  62. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/management/__init__.py
  63. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/management/commands/__init__.py
  64. 5 7
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/management/commands/debugsqlshell.py
  65. 37 32
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/middleware.py
  66. 21 2
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/__init__.py
  67. 33 42
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/cache.py
  68. 3 2
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/headers.py
  69. 7 4
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/logging.py
  70. 41 23
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/profiling.py
  71. 5 9
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/redirects.py
  72. 6 2
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/request.py
  73. 4 3
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/settings.py
  74. 12 13
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/signals.py
  75. 1 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/__init__.py
  76. 10 9
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/forms.py
  77. 18 14
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/panel.py
  78. 17 12
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/tracking.py
  79. 1 4
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/utils.py
  80. 12 8
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/views.py
  81. 12 10
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/staticfiles.py
  82. 1 1
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/templates/__init__.py
  83. 222 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/templates/panel.py
  84. 78 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/templates/views.py
  85. 8 5
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/timer.py
  86. 65 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/versions.py
  87. 161 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/settings.py
  88. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/css/print.css
  89. 10 5
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/css/toolbar.css
  90. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/ajax-loader.gif
  91. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/back.png
  92. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/back_hover.png
  93. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/close.png
  94. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/close_hover.png
  95. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/djdt_vertical.png
  96. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/indicator.png
  97. 0 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/js/jquery_existing.js
  98. 4 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/js/jquery_post.js
  99. 5 0
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/js/jquery_pre.js
  100. 13 12
      desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/js/toolbar.js

+ 0 - 36
desktop/core/ext-py/django-debug-toolbar-1.3.2/README.rst

@@ -1,36 +0,0 @@
-====================
-Django Debug Toolbar
-====================
-
-.. image:: https://secure.travis-ci.org/django-debug-toolbar/django-debug-toolbar.png
-    :alt: Build Status
-    :target: http://travis-ci.org/django-debug-toolbar/django-debug-toolbar
-
-The Django Debug Toolbar is a configurable set of panels that display various
-debug information about the current request/response and when clicked, display
-more details about the panel's content.
-
-Here's a screenshot of the toolbar in action:
-
-.. image:: https://raw.github.com/django-debug-toolbar/django-debug-toolbar/master/example/django-debug-toolbar.png
-   :width: 908
-   :height: 557
-
-In addition to the built-in panels, a number of third-party panels are
-contributed by the community.
-
-The current version of the Debug Toolbar is 1.3.2. It works on Django 1.4 to 1.8.
-
-If you're using Django 1.4, you will need Django ≥ 1.4.2 and Python ≥ 2.6.5.
-If you're using Django ≥ 1.5, there aren't any restrictions.
-
-Documentation, including installation and configuration instructions, is
-available at http://django-debug-toolbar.readthedocs.org/.
-
-The Django Debug Toolbar is released under the BSD license, like Django
-itself. If you like it, please consider contributing!
-
-The Django Debug Toolbar was originally created by Rob Hudson <rob@cogit8.org>
-in August 2008 and was further developed by many contributors_.
-
-.. _contributors: https://github.com/django-debug-toolbar/django-debug-toolbar/graphs/contributors

+ 0 - 16
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/apps.py

@@ -1,16 +0,0 @@
-from __future__ import absolute_import, unicode_literals
-
-from django.apps import AppConfig
-from django.utils.translation import ugettext_lazy as _
-
-from debug_toolbar import settings as dt_settings
-
-
-class DebugToolbarConfig(AppConfig):
-    name = 'debug_toolbar'
-    verbose_name = _("Debug Toolbar")
-
-    def ready(self):
-        if dt_settings.PATCH_SETTINGS:
-            dt_settings.patch_all()
-        dt_settings.check_middleware()

+ 0 - 114
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/compat.py

@@ -1,114 +0,0 @@
-"""
-This file exists to contain all Django and Python compatibility issues.
-
-In order to avoid circular references, nothing should be imported from
-debug_toolbar.
-"""
-
-import django
-from django.conf import settings
-from django.core.exceptions import ImproperlyConfigured
-
-try:
-    from django.core.cache import CacheHandler, caches
-except ImportError:  # Django < 1.7
-    CacheHandler = None
-    caches = None
-
-try:
-    from django.template.engine import Engine
-except ImportError:  # Django < 1.8
-    Engine = None
-    from django.template.context import get_standard_processors  # NOQA
-    from django.template.loader import find_template_loader  # NOQA
-
-try:
-    from importlib import import_module
-except ImportError:  # python = 2.6
-    from django.utils.importlib import import_module  # NOQA
-
-try:
-    from collections import OrderedDict
-except ImportError:  # python < 2.7
-    from django.utils.datastructures import SortedDict as OrderedDict  # NOQA
-
-try:
-    from django.contrib.staticfiles.testing import (
-        StaticLiveServerTestCase)
-except ImportError:  # Django < 1.7
-    from django.test import (  # NOQA
-        LiveServerTestCase as StaticLiveServerTestCase)
-
-try:
-    from django.db.backends import utils as db_backends_util
-except ImportError:  # Django >= 1.7
-    from django.db.backends import util as db_backends_util  # NOQA
-
-try:
-    from django.dispatch.dispatcher import WEAKREF_TYPES
-except ImportError:  # Django >= 1.7
-    import weakref
-    WEAKREF_TYPES = weakref.ReferenceType,
-
-
-def get_template_dirs():
-    """Compatibility method to fetch the template directories."""
-    if Engine:
-        try:
-            engine = Engine.get_default()
-        except ImproperlyConfigured:
-            template_dirs = []
-        else:
-            template_dirs = engine.dirs
-    else:  # Django < 1.8
-        template_dirs = settings.TEMPLATE_DIRS
-    return template_dirs
-
-
-def get_template_loaders():
-    """Compatibility method to fetch the template loaders."""
-    if Engine:
-        try:
-            engine = Engine.get_default()
-        except ImproperlyConfigured:
-            loaders = []
-        else:
-            loaders = engine.template_loaders
-    else:  # Django < 1.8
-        loaders = [
-            find_template_loader(loader_name)
-            for loader_name in settings.TEMPLATE_LOADERS]
-    return loaders
-
-
-def get_template_context_processors():
-    """Compatibility method to fetch the template context processors."""
-    if Engine:
-        try:
-            engine = Engine.get_default()
-        except ImproperlyConfigured:
-            context_processors = []
-        else:
-            context_processors = engine.template_context_processors
-    else:  # Django < 1.8
-        context_processors = get_standard_processors()
-    return context_processors
-
-if django.VERSION[:2] < (1, 5):
-    # If the user is using Django < 1.5, then load up the url tag
-    # from future. Otherwise use the normal one. The purpose of this
-    # is to get the url template tag that supports context variables
-    # for the first argument, yet won't raise a deprecation warning
-    # about importing it from future.
-    from django.templatetags.future import url
-else:
-    from django.template.defaulttags import url  # NOQA
-
-if django.VERSION[:2] < (1, 8):
-    # If the user is using Django < 1.8, then import the unittest
-    # library from Django so that it supports Python 2.6.
-    # Django >= 1.8 no longer supports Python 2.6, so in those cases
-    # simply load Python's unittest
-    from django.utils import unittest
-else:
-    import unittest  # NOQA

BIN
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/ru/LC_MESSAGES/django.mo


+ 0 - 9
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/models.py

@@ -1,9 +0,0 @@
-from __future__ import absolute_import, unicode_literals
-
-import django
-
-from debug_toolbar import settings as dt_settings
-
-
-if dt_settings.PATCH_SETTINGS and django.VERSION[:2] < (1, 7):
-    dt_settings.patch_all()

+ 0 - 1
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/sql/__init__.py

@@ -1 +0,0 @@
-from debug_toolbar.panels.sql.panel import SQLPanel                     # noqa

+ 0 - 227
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/templates/panel.py

@@ -1,227 +0,0 @@
-from __future__ import absolute_import, unicode_literals
-
-from contextlib import contextmanager
-from os.path import normpath
-from pprint import pformat
-
-import django
-from django import http
-from django.conf.urls import url
-from django.db.models.query import QuerySet, RawQuerySet
-from django.template import Context, RequestContext, Template
-from django.test.signals import template_rendered
-from django.test.utils import instrumented_test_render
-from django.utils.encoding import force_text
-from django.utils import six
-from django.utils.translation import ugettext_lazy as _
-
-from debug_toolbar.compat import (
-    OrderedDict, get_template_dirs, get_template_context_processors)
-from debug_toolbar.panels import Panel
-from debug_toolbar.panels.sql.tracking import recording, SQLQueryTriggered
-from debug_toolbar.panels.templates import views
-
-
-# Monkey-patch to enable the template_rendered signal. The receiver returns
-# immediately when the panel is disabled to keep the overhead small.
-
-# Code taken and adapted from Simon Willison and Django Snippets:
-# http://www.djangosnippets.org/snippets/766/
-
-if Template._render != instrumented_test_render:
-    Template.original_render = Template._render
-    Template._render = instrumented_test_render
-
-
-# Monkey-patch to store items added by template context processors. The
-# overhead is sufficiently small to justify enabling it unconditionally.
-
-if django.VERSION[:2] < (1, 8):
-
-    def _request_context___init__(
-            self, request, dict_=None, processors=None, current_app=None,
-            use_l10n=None, use_tz=None):
-        Context.__init__(
-            self, dict_, current_app=current_app,
-            use_l10n=use_l10n, use_tz=use_tz)
-        if processors is None:
-            processors = ()
-        else:
-            processors = tuple(processors)
-        self.context_processors = OrderedDict()
-        updates = dict()
-        std_processors = get_template_context_processors()
-        for processor in std_processors + processors:
-            name = '%s.%s' % (processor.__module__, processor.__name__)
-            context = processor(request)
-            self.context_processors[name] = context
-            updates.update(context)
-        self.update(updates)
-
-    RequestContext.__init__ = _request_context___init__
-
-else:
-
-    @contextmanager
-    def _request_context_bind_template(self, template):
-        if self.template is not None:
-            raise RuntimeError("Context is already bound to a template")
-
-        self.template = template
-        # Set context processors according to the template engine's settings.
-        processors = (template.engine.template_context_processors +
-                      self._processors)
-        self.context_processors = OrderedDict()
-        updates = {}
-        for processor in processors:
-            name = '%s.%s' % (processor.__module__, processor.__name__)
-            context = processor(self.request)
-            self.context_processors[name] = context
-            updates.update(context)
-        self.dicts[self._processors_index] = updates
-
-        try:
-            yield
-        finally:
-            self.template = None
-            # Unset context processors.
-            self.dicts[self._processors_index] = {}
-
-    RequestContext.bind_template = _request_context_bind_template
-
-
-# Monkey-patch versions of Django where Template doesn't store origin.
-# See https://code.djangoproject.com/ticket/16096.
-
-if django.VERSION[:2] < (1, 7):
-
-    old_template_init = Template.__init__
-
-    def new_template_init(self, template_string, origin=None, name='<Unknown Template>'):
-        old_template_init(self, template_string, origin, name)
-        self.origin = origin
-
-    Template.__init__ = new_template_init
-
-
-class TemplatesPanel(Panel):
-    """
-    A panel that lists all templates used during processing of a response.
-    """
-    def __init__(self, *args, **kwargs):
-        super(TemplatesPanel, self).__init__(*args, **kwargs)
-        self.templates = []
-
-    def _store_template_info(self, sender, **kwargs):
-        template, context = kwargs['template'], kwargs['context']
-
-        # Skip templates that we are generating through the debug toolbar.
-        if (isinstance(template.name, six.string_types) and
-                template.name.startswith('debug_toolbar/')):
-            return
-
-        context_list = []
-        for context_layer in context.dicts:
-            temp_layer = {}
-            if hasattr(context_layer, 'items'):
-                for key, value in context_layer.items():
-                    # Replace any request elements - they have a large
-                    # unicode representation and the request data is
-                    # already made available from the Request panel.
-                    if isinstance(value, http.HttpRequest):
-                        temp_layer[key] = '<<request>>'
-                    # Replace the debugging sql_queries element. The SQL
-                    # data is already made available from the SQL panel.
-                    elif key == 'sql_queries' and isinstance(value, list):
-                        temp_layer[key] = '<<sql_queries>>'
-                    # Replace LANGUAGES, which is available in i18n context processor
-                    elif key == 'LANGUAGES' and isinstance(value, tuple):
-                        temp_layer[key] = '<<languages>>'
-                    # QuerySet would trigger the database: user can run the query from SQL Panel
-                    elif isinstance(value, (QuerySet, RawQuerySet)):
-                        model_name = "%s.%s" % (
-                            value.model._meta.app_label, value.model.__name__)
-                        temp_layer[key] = '<<%s of %s>>' % (
-                            value.__class__.__name__.lower(), model_name)
-                    else:
-                        try:
-                            recording(False)
-                            pformat(value)  # this MAY trigger a db query
-                        except SQLQueryTriggered:
-                            temp_layer[key] = '<<triggers database query>>'
-                        except UnicodeEncodeError:
-                            temp_layer[key] = '<<unicode encode error>>'
-                        except Exception:
-                            temp_layer[key] = '<<unhandled exception>>'
-                        else:
-                            temp_layer[key] = value
-                        finally:
-                            recording(True)
-            try:
-                context_list.append(pformat(temp_layer))
-            except UnicodeEncodeError:
-                pass
-
-        kwargs['context'] = [force_text(item) for item in context_list]
-        kwargs['context_processors'] = getattr(context, 'context_processors', None)
-        self.templates.append(kwargs)
-
-    # Implement the Panel API
-
-    nav_title = _("Templates")
-
-    @property
-    def title(self):
-        num_templates = len(self.templates)
-        return _("Templates (%(num_templates)s rendered)") % {'num_templates': num_templates}
-
-    @property
-    def nav_subtitle(self):
-        if self.templates:
-            return self.templates[0]['template'].name
-        return ''
-
-    template = 'debug_toolbar/panels/templates.html'
-
-    @classmethod
-    def get_urls(cls):
-        return [
-            url(r'^template_source/$', views.template_source, name='template_source'),
-        ]
-
-    def enable_instrumentation(self):
-        template_rendered.connect(self._store_template_info)
-
-    def disable_instrumentation(self):
-        template_rendered.disconnect(self._store_template_info)
-
-    def process_response(self, request, response):
-        template_context = []
-        for template_data in self.templates:
-            info = {}
-            # Clean up some info about templates
-            template = template_data.get('template', None)
-            if hasattr(template, 'origin') and template.origin and template.origin.name:
-                template.origin_name = template.origin.name
-            else:
-                template.origin_name = _('No origin')
-            info['template'] = template
-            # Clean up context for better readability
-            if self.toolbar.config['SHOW_TEMPLATE_CONTEXT']:
-                context_list = template_data.get('context', [])
-                info['context'] = '\n'.join(context_list)
-            template_context.append(info)
-
-        # Fetch context_processors from any template
-        if self.templates:
-            context_processors = self.templates[0]['context_processors']
-        else:
-            context_processors = None
-
-        template_dirs = get_template_dirs()
-
-        self.record_stats({
-            'templates': template_context,
-            'template_dirs': [normpath(x) for x in template_dirs],
-            'context_processors': context_processors,
-        })

+ 0 - 55
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/templates/views.py

@@ -1,55 +0,0 @@
-from __future__ import absolute_import, unicode_literals
-
-from django.http import HttpResponseBadRequest
-from django.shortcuts import render_to_response
-from django.template import TemplateDoesNotExist
-from django.utils.safestring import mark_safe
-
-from debug_toolbar.compat import get_template_loaders
-
-
-def template_source(request):
-    """
-    Return the source of a template, syntax-highlighted by Pygments if
-    it's available.
-    """
-    template_name = request.GET.get('template', None)
-    if template_name is None:
-        return HttpResponseBadRequest('"template" key is required')
-
-    final_loaders = []
-    loaders = get_template_loaders()
-
-    for loader in loaders:
-        if loader is not None:
-            # When the loader has loaders associated with it,
-            # append those loaders to the list. This occurs with
-            # django.template.loaders.cached.Loader
-            if hasattr(loader, 'loaders'):
-                final_loaders += loader.loaders
-            else:
-                final_loaders.append(loader)
-
-    for loader in final_loaders:
-        try:
-            source, display_name = loader.load_template_source(template_name)
-            break
-        except TemplateDoesNotExist:
-            source = "Template Does Not Exist: %s" % (template_name,)
-
-    try:
-        from pygments import highlight
-        from pygments.lexers import HtmlDjangoLexer
-        from pygments.formatters import HtmlFormatter
-
-        source = highlight(source, HtmlDjangoLexer(), HtmlFormatter())
-        source = mark_safe(source)
-        source.pygmentized = True
-    except ImportError:
-        pass
-
-    # Using render_to_response avoids running global context processors.
-    return render_to_response('debug_toolbar/panels/template_source.html', {
-        'source': source,
-        'template_name': template_name
-    })

+ 0 - 71
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/versions.py

@@ -1,71 +0,0 @@
-from __future__ import absolute_import, unicode_literals
-
-import sys
-
-import django
-from django.conf import settings
-from django.utils.translation import ugettext_lazy as _
-
-from debug_toolbar.compat import import_module, OrderedDict
-from debug_toolbar.panels import Panel
-
-
-class VersionsPanel(Panel):
-    """
-    Shows versions of Python, Django, and installed apps if possible.
-    """
-    @property
-    def nav_subtitle(self):
-        return 'Django %s' % django.get_version()
-
-    title = _("Versions")
-
-    template = 'debug_toolbar/panels/versions.html'
-
-    def process_response(self, request, response):
-        versions = [
-            ('Python', '%d.%d.%d' % sys.version_info[:3]),
-            ('Django', self.get_app_version(django)),
-        ]
-        if django.VERSION[:2] >= (1, 7):
-            versions += list(self.gen_app_versions_1_7())
-        else:
-            versions += list(self.gen_app_versions_1_6())
-        self.record_stats({
-            'versions': OrderedDict(sorted(versions, key=lambda v: v[0])),
-            'paths': sys.path,
-        })
-
-    def gen_app_versions_1_7(self):
-        from django.apps import apps
-        for app_config in apps.get_app_configs():
-            name = app_config.verbose_name
-            app = app_config.module
-            version = self.get_app_version(app)
-            if version:
-                yield name, version
-
-    def gen_app_versions_1_6(self):
-        for app in list(settings.INSTALLED_APPS):
-            name = app.split('.')[-1].replace('_', ' ').capitalize()
-            app = import_module(app)
-            version = self.get_app_version(app)
-            if version:
-                yield name, version
-
-    def get_app_version(self, app):
-        if hasattr(app, 'get_version'):
-            get_version = app.get_version
-            if callable(get_version):
-                version = get_version()
-            else:
-                version = get_version
-        elif hasattr(app, 'VERSION'):
-            version = app.VERSION
-        elif hasattr(app, '__version__'):
-            version = app.__version__
-        else:
-            return
-        if isinstance(version, (list, tuple)):
-            version = '.'.join(str(o) for o in version)
-        return version

+ 0 - 232
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/settings.py

@@ -1,232 +0,0 @@
-from __future__ import absolute_import, unicode_literals
-
-import warnings
-
-from django.conf import settings
-from django.utils import six
-
-from debug_toolbar.compat import import_module
-
-
-# Always import this module as follows:
-# from debug_toolbar import settings [as dt_settings]
-
-# Don't import directly CONFIG or PANELs, or you will miss changes performed
-# with override_settings in tests.
-
-
-CONFIG_DEFAULTS = {
-    # Toolbar options
-    'DISABLE_PANELS': set(['debug_toolbar.panels.redirects.RedirectsPanel']),
-    'INSERT_BEFORE': '</body>',
-    'JQUERY_URL': '/static/debug_toolbar/jquery/2.1.4/jquery.min.js',
-    'RENDER_PANELS': None,
-    'RESULTS_CACHE_SIZE': 10,
-    'ROOT_TAG_EXTRA_ATTRS': '',
-    'SHOW_COLLAPSED': False,
-    'SHOW_TOOLBAR_CALLBACK': 'debug_toolbar.middleware.show_toolbar',
-    # Panel options
-    'EXTRA_SIGNALS': [],
-    'ENABLE_STACKTRACES': True,
-    'HIDE_IN_STACKTRACES': (
-        'socketserver' if six.PY3 else 'SocketServer',
-        'threading',
-        'wsgiref',
-        'debug_toolbar',
-        'django',
-    ),
-    'PROFILER_MAX_DEPTH': 10,
-    'SHOW_TEMPLATE_CONTEXT': True,
-    'SQL_WARNING_THRESHOLD': 500,   # milliseconds
-}
-
-USER_CONFIG = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {})
-# Backward-compatibility for 1.0, remove in 2.0.
-_RENAMED_CONFIG = {
-    'RESULTS_STORE_SIZE': 'RESULTS_CACHE_SIZE',
-    'ROOT_TAG_ATTRS': 'ROOT_TAG_EXTRA_ATTRS',
-    'HIDDEN_STACKTRACE_MODULES': 'HIDE_IN_STACKTRACES'
-}
-for old_name, new_name in _RENAMED_CONFIG.items():
-    if old_name in USER_CONFIG:
-        warnings.warn(
-            "%r was renamed to %r. Update your DEBUG_TOOLBAR_CONFIG "
-            "setting." % (old_name, new_name), DeprecationWarning)
-        USER_CONFIG[new_name] = USER_CONFIG.pop(old_name)
-if 'HIDE_DJANGO_SQL' in USER_CONFIG:
-    warnings.warn(
-        "HIDE_DJANGO_SQL was removed. Update your "
-        "DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning)
-    USER_CONFIG.pop('HIDE_DJANGO_SQL')
-if 'TAG' in USER_CONFIG:
-    warnings.warn(
-        "TAG was replaced by INSERT_BEFORE. Update your "
-        "DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning)
-    USER_CONFIG['INSERT_BEFORE'] = '</%s>' % USER_CONFIG.pop('TAG')
-
-CONFIG = CONFIG_DEFAULTS.copy()
-CONFIG.update(USER_CONFIG)
-
-
-PANELS_DEFAULTS = [
-    'debug_toolbar.panels.versions.VersionsPanel',
-    'debug_toolbar.panels.timer.TimerPanel',
-    'debug_toolbar.panels.settings.SettingsPanel',
-    'debug_toolbar.panels.headers.HeadersPanel',
-    'debug_toolbar.panels.request.RequestPanel',
-    'debug_toolbar.panels.sql.SQLPanel',
-    'debug_toolbar.panels.staticfiles.StaticFilesPanel',
-    'debug_toolbar.panels.templates.TemplatesPanel',
-    'debug_toolbar.panels.cache.CachePanel',
-    'debug_toolbar.panels.signals.SignalsPanel',
-    'debug_toolbar.panels.logging.LoggingPanel',
-    'debug_toolbar.panels.redirects.RedirectsPanel',
-]
-
-try:
-    PANELS = list(settings.DEBUG_TOOLBAR_PANELS)
-except AttributeError:
-    PANELS = PANELS_DEFAULTS
-else:
-    # Backward-compatibility for 1.0, remove in 2.0.
-    _RENAMED_PANELS = {
-        'debug_toolbar.panels.version.VersionDebugPanel':
-        'debug_toolbar.panels.versions.VersionsPanel',
-        'debug_toolbar.panels.timer.TimerDebugPanel':
-        'debug_toolbar.panels.timer.TimerPanel',
-        'debug_toolbar.panels.settings_vars.SettingsDebugPanel':
-        'debug_toolbar.panels.settings.SettingsPanel',
-        'debug_toolbar.panels.headers.HeaderDebugPanel':
-        'debug_toolbar.panels.headers.HeadersPanel',
-        'debug_toolbar.panels.request_vars.RequestVarsDebugPanel':
-        'debug_toolbar.panels.request.RequestPanel',
-        'debug_toolbar.panels.sql.SQLDebugPanel':
-        'debug_toolbar.panels.sql.SQLPanel',
-        'debug_toolbar.panels.template.TemplateDebugPanel':
-        'debug_toolbar.panels.templates.TemplatesPanel',
-        'debug_toolbar.panels.cache.CacheDebugPanel':
-        'debug_toolbar.panels.cache.CachePanel',
-        'debug_toolbar.panels.signals.SignalDebugPanel':
-        'debug_toolbar.panels.signals.SignalsPanel',
-        'debug_toolbar.panels.logger.LoggingDebugPanel':
-        'debug_toolbar.panels.logging.LoggingPanel',
-        'debug_toolbar.panels.redirects.InterceptRedirectsDebugPanel':
-        'debug_toolbar.panels.redirects.RedirectsPanel',
-        'debug_toolbar.panels.profiling.ProfilingDebugPanel':
-        'debug_toolbar.panels.profiling.ProfilingPanel',
-    }
-    for index, old_panel in enumerate(PANELS):
-        new_panel = _RENAMED_PANELS.get(old_panel)
-        if new_panel is not None:
-            warnings.warn(
-                "%r was renamed to %r. Update your DEBUG_TOOLBAR_PANELS "
-                "setting." % (old_panel, new_panel), DeprecationWarning)
-            PANELS[index] = new_panel
-
-
-if 'INTERCEPT_REDIRECTS' in USER_CONFIG:
-    warnings.warn(
-        "INTERCEPT_REDIRECTS is deprecated. Please use the "
-        "DISABLE_PANELS config in the "
-        "DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning)
-    if USER_CONFIG['INTERCEPT_REDIRECTS']:
-        if 'debug_toolbar.panels.redirects.RedirectsPanel' \
-                in CONFIG['DISABLE_PANELS']:
-            # RedirectsPanel should be enabled
-            try:
-                CONFIG['DISABLE_PANELS'].remove(
-                    'debug_toolbar.panels.redirects.RedirectsPanel'
-                )
-            except KeyError:
-                # We wanted to remove it, but it didn't exist. This is fine
-                pass
-    elif 'debug_toolbar.panels.redirects.RedirectsPanel' \
-            not in CONFIG['DISABLE_PANELS']:
-        # RedirectsPanel should be disabled
-        CONFIG['DISABLE_PANELS'].add(
-            'debug_toolbar.panels.redirects.RedirectsPanel'
-        )
-
-PATCH_SETTINGS = getattr(settings, 'DEBUG_TOOLBAR_PATCH_SETTINGS', settings.DEBUG)
-
-
-# The following functions can monkey-patch settings automatically. Several
-# imports are placed inside functions to make it safe to import this module.
-
-
-def check_middleware():
-    from django.middleware.gzip import GZipMiddleware
-    from debug_toolbar.middleware import DebugToolbarMiddleware
-    gzip_index = None
-    debug_toolbar_index = None
-
-    # Determine the indexes which gzip and/or the toolbar are installed at
-    for i, middleware in enumerate(settings.MIDDLEWARE_CLASSES):
-        if is_middleware_class(GZipMiddleware, middleware):
-            gzip_index = i
-        elif is_middleware_class(DebugToolbarMiddleware, middleware):
-            debug_toolbar_index = i
-    # If the toolbar appears before the gzip index, raise a warning
-    if gzip_index is not None and debug_toolbar_index < gzip_index:
-        warnings.warn(
-            "Please use an explicit setup with the "
-            "debug_toolbar.middleware.DebugToolbarMiddleware "
-            "after django.middleware.gzip.GZipMiddlware "
-            "in MIDDLEWARE_CLASSES.", Warning)
-
-
-def is_middleware_class(middleware_class, middleware_path):
-    # This could be replaced by import_by_path in Django >= 1.6.
-    try:
-        mod_path, cls_name = middleware_path.rsplit('.', 1)
-        mod = import_module(mod_path)
-        middleware_cls = getattr(mod, cls_name)
-    except (AttributeError, ImportError, ValueError):
-        return
-    return issubclass(middleware_cls, middleware_class)
-
-
-def is_toolbar_middleware_installed():
-    from debug_toolbar.middleware import DebugToolbarMiddleware
-    return any(is_middleware_class(DebugToolbarMiddleware, middleware)
-               for middleware in settings.MIDDLEWARE_CLASSES)
-
-
-def prepend_to_setting(setting_name, value):
-    """Insert value at the beginning of a list or tuple setting."""
-    values = getattr(settings, setting_name)
-    # Make a list [value] or tuple (value,)
-    value = type(values)((value,))
-    setattr(settings, setting_name, value + values)
-
-
-def patch_internal_ips():
-    if not settings.INTERNAL_IPS:
-        prepend_to_setting('INTERNAL_IPS', '127.0.0.1')
-        prepend_to_setting('INTERNAL_IPS', '::1')
-
-
-def patch_middleware_classes():
-    if not is_toolbar_middleware_installed():
-        prepend_to_setting('MIDDLEWARE_CLASSES',
-                           'debug_toolbar.middleware.DebugToolbarMiddleware')
-
-
-def patch_root_urlconf():
-    from django.conf.urls import include, url
-    from django.core.urlresolvers import clear_url_caches, reverse, NoReverseMatch
-    import debug_toolbar
-    try:
-        reverse('djdt:render_panel')
-    except NoReverseMatch:
-        urlconf_module = import_module(settings.ROOT_URLCONF)
-        urlconf_module.urlpatterns = [
-            url(r'^__debug__/', include(debug_toolbar.urls)),
-        ] + urlconf_module.urlpatterns
-        clear_url_caches()
-
-
-def patch_all():
-    patch_internal_ips()
-    patch_middleware_classes()
-    patch_root_urlconf()

+ 0 - 1
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/js/jquery_post.js

@@ -1 +0,0 @@
-var djdt = {jQuery: jQuery.noConflict(true)}; window.define = _djdt_define_backup;

+ 0 - 1
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/js/jquery_pre.js

@@ -1 +0,0 @@
-var _djdt_define_backup = window.define; window.define = undefined;

+ 0 - 22
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/templatetags/debug_toolbar_compat.py

@@ -1,22 +0,0 @@
-from django.template.base import Library
-
-from ..compat import url as url_compat
-
-"""
-https://github.com/jazzband/django-debug-toolbar/commit/fe437aaca243aef4fa1d65eb916009ca5be3d655#diff-7da931685952c08fceacc7d0f71f1a46
-	modified:   desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/templates/debug_toolbar/base.html
-	modified:   desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/templates/debug_toolbar/panels/sql.html
-	modified:   desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/templates/debug_toolbar/panels/templates.html
-	renamed:    desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/templatetags/compat.py -> desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/templatetags/debug_toolbar_compat.py
-	modified:   desktop/core/src/desktop/settings.py
-	modified:   desktop/core/src/desktop/templates/debug_toolbar/base.html
-	modified:   desktop/core/src/desktop/templates/debug_toolbar/panels/sql.html
-	modified:   desktop/core/src/desktop/templates/debug_toolbar/panels/templates.html
-"""
-
-register = Library()
-
-
-@register.tag
-def url(parser, token):
-    return url_compat(parser, token)

+ 0 - 12
desktop/core/ext-py/django-debug-toolbar-1.3.2/setup.cfg

@@ -1,12 +0,0 @@
-[egg_info]
-tag_svn_revision = 0
-tag_build = 
-tag_date = 0
-
-[flake8]
-ignore = W601
-max-line-length = 100
-
-[wheel]
-universal = 1
-

+ 7 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/CONTRIBUTING.md

@@ -0,0 +1,7 @@
+[![Jazzband](https://jazzband.co/static/img/jazzband.svg)](https://jazzband.co/)
+
+This is a [Jazzband](https://jazzband.co/) project. By contributing you agree to abide by the [Contributor Code of Conduct](https://jazzband.co/about/conduct) and follow the [guidelines](https://jazzband.co/about/guidelines).
+
+Please see the
+[full contributing documentation](https://django-debug-toolbar.readthedocs.io/en/stable/contributing.html)
+for more help.

+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/LICENSE → desktop/core/ext-py/django-debug-toolbar-1.9.1/LICENSE


+ 1 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/MANIFEST.in → desktop/core/ext-py/django-debug-toolbar-1.9.1/MANIFEST.in

@@ -1,5 +1,6 @@
 include LICENSE
 include README.rst
+include CONTRIBUTING.md
 recursive-include debug_toolbar/locale *
 recursive-include debug_toolbar/static *
 recursive-include debug_toolbar/templates *

+ 28 - 14
desktop/core/ext-py/django-debug-toolbar-1.3.2/PKG-INFO → desktop/core/ext-py/django-debug-toolbar-1.9.1/PKG-INFO

@@ -1,8 +1,8 @@
 Metadata-Version: 1.1
 Name: django-debug-toolbar
-Version: 1.3.2
+Version: 1.9.1
 Summary: A configurable set of panels that display various debug information about the current request/response.
-Home-page: https://github.com/django-debug-toolbar/django-debug-toolbar
+Home-page: https://github.com/jazzband/django-debug-toolbar
 Author: Rob Hudson
 Author-email: rob@cogit8.org
 License: BSD
@@ -11,9 +11,21 @@ Description: ====================
         Django Debug Toolbar
         ====================
         
-        .. image:: https://secure.travis-ci.org/django-debug-toolbar/django-debug-toolbar.png
-            :alt: Build Status
-            :target: http://travis-ci.org/django-debug-toolbar/django-debug-toolbar
+        .. image:: https://jazzband.co/static/img/badge.svg
+           :target: https://jazzband.co/
+           :alt: Jazzband
+        
+        .. image:: https://travis-ci.org/jazzband/django-debug-toolbar.svg?branch=master
+           :target: https://travis-ci.org/jazzband/django-debug-toolbar
+           :alt: Build Status
+        
+        .. image:: https://codecov.io/gh/jazzband/django-debug-toolbar/branch/master/graph/badge.svg
+           :target: https://codecov.io/gh/jazzband/django-debug-toolbar
+           :alt: Test coverage status
+        
+        .. image:: https://requires.io/github/jazzband/django-debug-toolbar/requirements.svg?branch=master
+             :target: https://requires.io/github/jazzband/django-debug-toolbar/requirements/?branch=master
+             :alt: Requirements Status
         
         The Django Debug Toolbar is a configurable set of panels that display various
         debug information about the current request/response and when clicked, display
@@ -21,20 +33,17 @@ Description: ====================
         
         Here's a screenshot of the toolbar in action:
         
-        .. image:: https://raw.github.com/django-debug-toolbar/django-debug-toolbar/master/example/django-debug-toolbar.png
+        .. image:: https://raw.github.com/jazzband/django-debug-toolbar/master/example/django-debug-toolbar.png
            :width: 908
            :height: 557
         
         In addition to the built-in panels, a number of third-party panels are
         contributed by the community.
         
-        The current version of the Debug Toolbar is 1.3.2. It works on Django 1.4 to 1.8.
-        
-        If you're using Django 1.4, you will need Django ≥ 1.4.2 and Python ≥ 2.6.5.
-        If you're using Django ≥ 1.5, there aren't any restrictions.
+        The current version of the Debug Toolbar is 1.9. It works on Django ≥ 1.8.
         
         Documentation, including installation and configuration instructions, is
-        available at http://django-debug-toolbar.readthedocs.org/.
+        available at https://django-debug-toolbar.readthedocs.io/.
         
         The Django Debug Toolbar is released under the BSD license, like Django
         itself. If you like it, please consider contributing!
@@ -42,21 +51,26 @@ Description: ====================
         The Django Debug Toolbar was originally created by Rob Hudson <rob@cogit8.org>
         in August 2008 and was further developed by many contributors_.
         
-        .. _contributors: https://github.com/django-debug-toolbar/django-debug-toolbar/graphs/contributors
+        .. _contributors: https://github.com/jazzband/django-debug-toolbar/graphs/contributors
         
 Platform: UNKNOWN
 Classifier: Development Status :: 5 - Production/Stable
 Classifier: Environment :: Web Environment
 Classifier: Framework :: Django
+Classifier: Framework :: Django :: 1.8
+Classifier: Framework :: Django :: 1.9
+Classifier: Framework :: Django :: 1.10
+Classifier: Framework :: Django :: 1.11
+Classifier: Framework :: Django :: 2.0
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: BSD License
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python
 Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
 Classifier: Programming Language :: Python :: 3.3
 Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
 Classifier: Topic :: Software Development :: Libraries :: Python Modules

+ 45 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/README.rst

@@ -0,0 +1,45 @@
+====================
+Django Debug Toolbar
+====================
+
+.. image:: https://jazzband.co/static/img/badge.svg
+   :target: https://jazzband.co/
+   :alt: Jazzband
+
+.. image:: https://travis-ci.org/jazzband/django-debug-toolbar.svg?branch=master
+   :target: https://travis-ci.org/jazzband/django-debug-toolbar
+   :alt: Build Status
+
+.. image:: https://codecov.io/gh/jazzband/django-debug-toolbar/branch/master/graph/badge.svg
+   :target: https://codecov.io/gh/jazzband/django-debug-toolbar
+   :alt: Test coverage status
+
+.. image:: https://requires.io/github/jazzband/django-debug-toolbar/requirements.svg?branch=master
+     :target: https://requires.io/github/jazzband/django-debug-toolbar/requirements/?branch=master
+     :alt: Requirements Status
+
+The Django Debug Toolbar is a configurable set of panels that display various
+debug information about the current request/response and when clicked, display
+more details about the panel's content.
+
+Here's a screenshot of the toolbar in action:
+
+.. image:: https://raw.github.com/jazzband/django-debug-toolbar/master/example/django-debug-toolbar.png
+   :width: 908
+   :height: 557
+
+In addition to the built-in panels, a number of third-party panels are
+contributed by the community.
+
+The current version of the Debug Toolbar is 1.9. It works on Django ≥ 1.8.
+
+Documentation, including installation and configuration instructions, is
+available at https://django-debug-toolbar.readthedocs.io/.
+
+The Django Debug Toolbar is released under the BSD license, like Django
+itself. If you like it, please consider contributing!
+
+The Django Debug Toolbar was originally created by Rob Hudson <rob@cogit8.org>
+in August 2008 and was further developed by many contributors_.
+
+.. _contributors: https://github.com/jazzband/django-debug-toolbar/graphs/contributors

+ 5 - 3
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/__init__.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/__init__.py

@@ -1,5 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
+import django
 
 __all__ = ['VERSION']
 
@@ -12,9 +13,10 @@ except Exception:
 
 
 # Code that discovers files or modules in INSTALLED_APPS imports this module.
-# Reference URLpatterns with a string to avoid the risk of circular imports.
-
-urls = 'debug_toolbar.toolbar', 'djdt', 'djdt'
 
+if django.VERSION < (1, 9):
+    urls = 'debug_toolbar.toolbar', 'djdt', 'djdt'
+else:
+    urls = 'debug_toolbar.toolbar', 'djdt'
 
 default_app_config = 'debug_toolbar.apps.DebugToolbarConfig'

+ 71 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/apps.py

@@ -0,0 +1,71 @@
+from __future__ import absolute_import, unicode_literals
+
+import inspect
+
+from django.apps import AppConfig
+from django.conf import settings
+from django.core.checks import Error, register
+from django.middleware.gzip import GZipMiddleware
+from django.utils.module_loading import import_string
+from django.utils.translation import ugettext_lazy as _
+
+
+class DebugToolbarConfig(AppConfig):
+    name = 'debug_toolbar'
+    verbose_name = _("Debug Toolbar")
+
+
+@register
+def check_middleware(app_configs, **kwargs):
+    from debug_toolbar.middleware import DebugToolbarMiddleware
+
+    errors = []
+    gzip_index = None
+    debug_toolbar_index = None
+
+    setting = getattr(settings, 'MIDDLEWARE', None)
+    setting_name = 'MIDDLEWARE'
+    if setting is None:
+        setting = settings.MIDDLEWARE_CLASSES
+        setting_name = 'MIDDLEWARE_CLASSES'
+
+    # Determine the indexes which gzip and/or the toolbar are installed at
+    for i, middleware in enumerate(setting):
+        if is_middleware_class(GZipMiddleware, middleware):
+            gzip_index = i
+        elif is_middleware_class(DebugToolbarMiddleware, middleware):
+            debug_toolbar_index = i
+
+    if debug_toolbar_index is None:
+        # If the toolbar does not appear, report an error.
+        errors.append(
+            Error(
+                "debug_toolbar.middleware.DebugToolbarMiddleware is missing "
+                "from %s." % setting_name,
+                hint="Add debug_toolbar.middleware.DebugToolbarMiddleware to "
+                "%s." % setting_name,
+            )
+        )
+    elif gzip_index is not None and debug_toolbar_index < gzip_index:
+        # If the toolbar appears before the gzip index, report an error.
+        errors.append(
+            Error(
+                "debug_toolbar.middleware.DebugToolbarMiddleware occurs before "
+                "django.middleware.gzip.GZipMiddleware in %s." % setting_name,
+                hint="Move debug_toolbar.middleware.DebugToolbarMiddleware to "
+                "after django.middleware.gzip.GZipMiddleware in %s." % setting_name,
+            )
+        )
+
+    return errors
+
+
+def is_middleware_class(middleware_class, middleware_path):
+    try:
+        middleware_cls = import_string(middleware_path)
+    except ImportError:
+        return
+    return (
+        inspect.isclass(middleware_cls) and
+        issubclass(middleware_cls, middleware_class)
+    )

+ 11 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/compat.py

@@ -0,0 +1,11 @@
+"""
+This file exists to contain all Django and Python compatibility issues.
+
+In order to avoid circular references, nothing should be imported from
+debug_toolbar.
+"""
+
+try:
+    from django.template.base import linebreak_iter  # NOQA
+except ImportError:  # Django < 1.9
+    from django.views.debug import linebreak_iter  # NOQA

+ 16 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/decorators.py

@@ -0,0 +1,16 @@
+import functools
+
+from django.http import Http404
+
+
+def require_show_toolbar(view):
+    @functools.wraps(view)
+    def inner(request, *args, **kwargs):
+        from debug_toolbar.middleware import get_show_toolbar
+
+        show_toolbar = get_show_toolbar()
+        if not show_toolbar(request):
+            raise Http404
+
+        return view(request, *args, **kwargs)
+    return inner

+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/ca/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/ca/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/ca/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/ca/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/cs/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/cs/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/cs/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/cs/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/de/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/de/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/de/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/de/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/en/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/en/LC_MESSAGES/django.mo


+ 23 - 13
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/en/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/en/LC_MESSAGES/django.po

@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Django Debug Toolbar\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-05-27 19:40-0400\n"
+"POT-Creation-Date: 2015-07-06 16:50-0400\n"
 "PO-Revision-Date: 2012-03-31 20:10+0000\n"
 "Last-Translator: \n"
 "Language-Team: \n"
@@ -20,18 +20,18 @@ msgstr ""
 msgid "Debug Toolbar"
 msgstr ""
 
-#: panels/cache.py:197
+#: panels/cache.py:209
 msgid "Cache"
 msgstr ""
 
-#: panels/cache.py:202
+#: panels/cache.py:214
 #, python-format
 msgid "%(cache_calls)d call in %(time).2fms"
 msgid_plural "%(cache_calls)d calls in %(time).2fms"
 msgstr[0] ""
 msgstr[1] ""
 
-#: panels/cache.py:210
+#: panels/cache.py:222
 #, python-format
 msgid "Cache calls from %(count)d backend"
 msgid_plural "Cache calls from %(count)d backends"
@@ -292,7 +292,7 @@ msgid "Calls"
 msgstr ""
 
 #: templates/debug_toolbar/panels/cache.html:43
-#: templates/debug_toolbar/panels/sql.html:20
+#: templates/debug_toolbar/panels/sql.html:23
 msgid "Time (ms)"
 msgstr ""
 
@@ -466,36 +466,46 @@ msgid_plural "%(num)s queries"
 msgstr[0] ""
 msgstr[1] ""
 
-#: templates/debug_toolbar/panels/sql.html:18
+#: templates/debug_toolbar/panels/sql.html:9
+#, python-format
+msgid "including %(dupes)s duplicates"
+msgstr ""
+
+#: templates/debug_toolbar/panels/sql.html:21
 msgid "Query"
 msgstr ""
 
-#: templates/debug_toolbar/panels/sql.html:19
+#: templates/debug_toolbar/panels/sql.html:22
 #: templates/debug_toolbar/panels/timer.html:36
 msgid "Timeline"
 msgstr ""
 
-#: templates/debug_toolbar/panels/sql.html:21
+#: templates/debug_toolbar/panels/sql.html:24
 msgid "Action"
 msgstr ""
 
-#: templates/debug_toolbar/panels/sql.html:64
+#: templates/debug_toolbar/panels/sql.html:39
+#, python-format
+msgid "Duplicated %(dupes)s times."
+msgstr ""
+
+#: templates/debug_toolbar/panels/sql.html:71
 msgid "Connection:"
 msgstr ""
 
-#: templates/debug_toolbar/panels/sql.html:66
+#: templates/debug_toolbar/panels/sql.html:73
 msgid "Isolation level:"
 msgstr ""
 
-#: templates/debug_toolbar/panels/sql.html:69
+#: templates/debug_toolbar/panels/sql.html:76
 msgid "Transaction status:"
 msgstr ""
 
-#: templates/debug_toolbar/panels/sql.html:83
+#: templates/debug_toolbar/panels/sql.html:90
 msgid "(unknown)"
 msgstr ""
 
-#: templates/debug_toolbar/panels/sql.html:92
+#: templates/debug_toolbar/panels/sql.html:99
 msgid "No SQL queries were recorded during this request."
 msgstr ""
 

+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/es/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/es/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/es/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/es/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/fi/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/fi/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/fi/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/fi/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/fr/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/fr/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/fr/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/fr/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/he/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/he/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/he/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/he/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/id/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/id/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/id/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/id/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/it/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/it/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/it/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/it/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/nl/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/nl/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/nl/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/nl/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/pl/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pl/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/pl/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pl/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/pt/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pt/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/pt/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pt/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.po


BIN
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/ru/LC_MESSAGES/django.mo


+ 209 - 186
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/ru/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/ru/LC_MESSAGES/django.po

@@ -1,7 +1,7 @@
 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the PACKAGE package.
-# 
-# 
+#
+#
 # Translators:
 # Ilya Baryshev <baryshev@gmail.com>, 2013
 # Mikhail Korobov, 2009
@@ -10,55 +10,52 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Django Debug Toolbar\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-04-25 21:52+0200\n"
-"PO-Revision-Date: 2014-04-25 19:53+0000\n"
-"Last-Translator: Aymeric Augustin <aymeric.augustin@m4x.org>\n"
-"Language-Team: Russian (http://www.transifex.com/projects/p/django-debug-toolbar/language/ru/)\n"
+"POT-Creation-Date: 2016-07-21 16:45+0600\n"
+"PO-Revision-Date: 2016-07-21 17:22+0600\n"
+"Last-Translator: Igor 'idle sign' Starikov <idlesign@yandex.ru>\n"
+"Language-Team: Russian (http://www.transifex.com/projects/p/django-debug-"
+"toolbar/language/ru/)\n"
+"Language: ru\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Language: ru\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: Poedit 1.8.7.1\n"
 
 #: apps.py:11
 msgid "Debug Toolbar"
-msgstr ""
-
-#: views.py:14
-msgid ""
-"Data for this panel isn't available anymore. Please reload the page and "
-"retry."
-msgstr "Данные этой панели больше недоступны. Пожалуйста, перезагрузите страницу и попробуйте ещё раз."
+msgstr "Отладочная панель"
 
-#: panels/cache.py:191
+#: panels/cache.py:204
 msgid "Cache"
-msgstr "Кэш"
+msgstr "Кеш"
 
-#: panels/cache.py:196
+#: panels/cache.py:209
 #, python-format
 msgid "%(cache_calls)d call in %(time).2fms"
 msgid_plural "%(cache_calls)d calls in %(time).2fms"
-msgstr[0] "%(cache_calls)d обращение за %(time).2fms"
-msgstr[1] "%(cache_calls)d обращения за %(time).2fms"
-msgstr[2] "%(cache_calls)d обращений за %(time).2fms"
+msgstr[0] "%(cache_calls)d обращение за %(time).2f мс"
+msgstr[1] "%(cache_calls)d обращения за %(time).2f мс"
+msgstr[2] "%(cache_calls)d обращений за %(time).2f мс"
 
-#: panels/cache.py:204
+#: panels/cache.py:217
 #, python-format
 msgid "Cache calls from %(count)d backend"
 msgid_plural "Cache calls from %(count)d backends"
-msgstr[0] "Обращения к кэшу от %(count)d бэкенда"
-msgstr[1] "Обращения к кэшу от %(count)d бэкендов"
-msgstr[2] "Обращения к кэшу от %(count)d бэкендов"
+msgstr[0] "Обращения к кешу от %(count)d бэкенда"
+msgstr[1] "Обращения к кешу от %(count)d бэкендов"
+msgstr[2] "Обращения к кешу от %(count)d бэкендов"
 
-#: panels/headers.py:35
+#: panels/headers.py:34
 msgid "Headers"
 msgstr "Заголовки"
 
-#: panels/logging.py:64
+#: panels/logging.py:66
 msgid "Logging"
 msgstr "Логи"
 
-#: panels/logging.py:70
+#: panels/logging.py:72
 #, python-format
 msgid "%(count)s message"
 msgid_plural "%(count)s messages"
@@ -66,17 +63,17 @@ msgstr[0] "%(count)s сообщение"
 msgstr[1] "%(count)s сообщений"
 msgstr[2] "%(count)s сообщений"
 
-#: panels/logging.py:73
+#: panels/logging.py:75
 msgid "Log messages"
 msgstr "Сообщения в логе"
 
-#: panels/profiling.py:127
+#: panels/profiling.py:144
 msgid "Profiling"
 msgstr "Профилирование"
 
-#: panels/redirects.py:17
+#: panels/redirects.py:16
 msgid "Intercept redirects"
-msgstr "Перехват редиректов"
+msgstr "Перехватывать перенаправления"
 
 #: panels/request.py:18
 msgid "Request"
@@ -84,22 +81,22 @@ msgstr "Запрос"
 
 #: panels/request.py:35
 msgid "<no view>"
-msgstr "<нет view>"
+msgstr "<нет представления>"
 
 #: panels/request.py:47
 msgid "<unavailable>"
 msgstr "<недоступно>"
 
-#: panels/settings.py:20
+#: panels/settings.py:18
 msgid "Settings"
 msgstr "Настройки"
 
-#: panels/settings.py:23
+#: panels/settings.py:21
 #, python-format
 msgid "Settings from <code>%s</code>"
 msgstr "Настройки из <code>%s</code>"
 
-#: panels/signals.py:45
+#: panels/signals.py:44
 #, python-format
 msgid "%(num_receivers)d receiver of 1 signal"
 msgid_plural "%(num_receivers)d receivers of 1 signal"
@@ -107,7 +104,7 @@ msgstr[0] "%(num_receivers)d получатель 1 сигнала"
 msgstr[1] "%(num_receivers)d получателя 1 сигнала"
 msgstr[2] "%(num_receivers)d получателей 1 сигнала"
 
-#: panels/signals.py:48
+#: panels/signals.py:47
 #, python-format
 msgid "%(num_receivers)d receiver of %(num_signals)d signals"
 msgid_plural "%(num_receivers)d receivers of %(num_signals)d signals"
@@ -115,146 +112,150 @@ msgstr[0] "%(num_receivers)d получатель %(num_signals)d сигнала
 msgstr[1] "%(num_receivers)d получателя %(num_signals)d сигнала(ов)"
 msgstr[2] "%(num_receivers)d получателей %(num_signals)d сигнала(ов)"
 
-#: panels/signals.py:53
+#: panels/signals.py:52
 msgid "Signals"
 msgstr "Сигналы"
 
-#: panels/staticfiles.py:89
+#: panels/sql/panel.py:25
+msgid "Autocommit"
+msgstr "Autocommit"
+
+#: panels/sql/panel.py:26
+msgid "Read uncommitted"
+msgstr "Read uncommitted"
+
+#: panels/sql/panel.py:27
+msgid "Read committed"
+msgstr "Read committed"
+
+#: panels/sql/panel.py:28
+msgid "Repeatable read"
+msgstr "Repeatable read"
+
+#: panels/sql/panel.py:29
+msgid "Serializable"
+msgstr "Сериализуемый"
+
+#: panels/sql/panel.py:40
+msgid "Idle"
+msgstr "Ожидание"
+
+#: panels/sql/panel.py:41
+msgid "Active"
+msgstr "Действие"
+
+#: panels/sql/panel.py:42
+msgid "In transaction"
+msgstr "В транзакции"
+
+#: panels/sql/panel.py:43
+msgid "In error"
+msgstr "Ошибка"
+
+#: panels/sql/panel.py:44
+msgid "Unknown"
+msgstr "Неизвестно"
+
+#: panels/sql/panel.py:108
+msgid "SQL"
+msgstr "SQL"
+
+#: panels/staticfiles.py:87
 #, python-format
 msgid "Static files (%(num_found)s found, %(num_used)s used)"
-msgstr ""
+msgstr "Файлов статики (вего: %(num_found)s, использовано: %(num_used)s)"
 
-#: panels/staticfiles.py:107
+#: panels/staticfiles.py:105
 msgid "Static files"
-msgstr ""
+msgstr "Статика"
 
-#: panels/staticfiles.py:112
+#: panels/staticfiles.py:110
 #, python-format
 msgid "%(num_used)s file used"
 msgid_plural "%(num_used)s files used"
-msgstr[0] ""
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "%(num_used)s файл используется"
+msgstr[1] "%(num_used)s файла используются"
+msgstr[2] "%(num_used)s файлов используются"
 
-#: panels/timer.py:23
+#: panels/templates/panel.py:128
+msgid "Templates"
+msgstr "Шаблоны"
+
+#: panels/templates/panel.py:133
+#, python-format
+msgid "Templates (%(num_templates)s rendered)"
+msgstr "Шаблоны (обработано %(num_templates)s)"
+
+#: panels/templates/panel.py:164
+msgid "No origin"
+msgstr "Нет источника"
+
+#: panels/timer.py:26
 #, python-format
 msgid "CPU: %(cum)0.2fms (%(total)0.2fms)"
-msgstr "CPU: %(cum)0.2fms (%(total)0.2fms)"
+msgstr "CPU: %(cum)0.2f мс (%(total)0.2f мс)"
 
-#: panels/timer.py:28
+#: panels/timer.py:31
 #, python-format
 msgid "Total: %0.2fms"
-msgstr "Итого: %0.2fms"
+msgstr "Итого: %0.2f мс"
 
-#: panels/timer.py:34 templates/debug_toolbar/panels/logging.html:7
+#: panels/timer.py:37 templates/debug_toolbar/panels/logging.html:7
 #: templates/debug_toolbar/panels/sql_explain.html:11
 #: templates/debug_toolbar/panels/sql_profile.html:12
 #: templates/debug_toolbar/panels/sql_select.html:11
 msgid "Time"
 msgstr "Время"
 
-#: panels/timer.py:42
+#: panels/timer.py:45
 msgid "User CPU time"
-msgstr "User CPU time"
+msgstr "Пользовательское время ядра"
 
-#: panels/timer.py:42
+#: panels/timer.py:45
 #, python-format
 msgid "%(utime)0.3f msec"
 msgstr "%(utime)0.3f мс"
 
-#: panels/timer.py:43
+#: panels/timer.py:46
 msgid "System CPU time"
-msgstr "System CPU time"
+msgstr "Системное время ядра"
 
-#: panels/timer.py:43
+#: panels/timer.py:46
 #, python-format
 msgid "%(stime)0.3f msec"
 msgstr "%(stime)0.3f мс"
 
-#: panels/timer.py:44
+#: panels/timer.py:47
 msgid "Total CPU time"
-msgstr "Total CPU time"
+msgstr "Общее время ядра"
 
-#: panels/timer.py:44
+#: panels/timer.py:47
 #, python-format
 msgid "%(total)0.3f msec"
 msgstr "%(total)0.3f мс"
 
-#: panels/timer.py:45
+#: panels/timer.py:48
 msgid "Elapsed time"
 msgstr "Затраченное время"
 
-#: panels/timer.py:45
+#: panels/timer.py:48
 #, python-format
 msgid "%(total_time)0.3f msec"
 msgstr "%(total_time)0.3f мс"
 
-#: panels/timer.py:46
+#: panels/timer.py:49
 msgid "Context switches"
-msgstr "Переключений контекста"
+msgstr "Переключения контекста"
 
-#: panels/timer.py:46
+#: panels/timer.py:49
 #, python-format
 msgid "%(vcsw)d voluntary, %(ivcsw)d involuntary"
 msgstr "%(vcsw)d намеренных, %(ivcsw)d вынужденных"
 
-#: panels/versions.py:25
+#: panels/versions.py:20
 msgid "Versions"
 msgstr "Версии"
 
-#: panels/sql/panel.py:22
-msgid "Autocommit"
-msgstr "Autocommit"
-
-#: panels/sql/panel.py:23
-msgid "Read uncommitted"
-msgstr "Read uncommitted"
-
-#: panels/sql/panel.py:24
-msgid "Read committed"
-msgstr "Read committed"
-
-#: panels/sql/panel.py:25
-msgid "Repeatable read"
-msgstr "Repeatable read"
-
-#: panels/sql/panel.py:26
-msgid "Serializable"
-msgstr "Serializable"
-
-#: panels/sql/panel.py:37
-msgid "Idle"
-msgstr "Ожидание"
-
-#: panels/sql/panel.py:38
-msgid "Active"
-msgstr "Действие"
-
-#: panels/sql/panel.py:39
-msgid "In transaction"
-msgstr "В транзакции"
-
-#: panels/sql/panel.py:40
-msgid "In error"
-msgstr "Ошибка"
-
-#: panels/sql/panel.py:41
-msgid "Unknown"
-msgstr "Неизвестно"
-
-#: panels/sql/panel.py:105
-msgid "SQL"
-msgstr "SQL"
-
-#: panels/templates/panel.py:141
-msgid "Templates"
-msgstr "Шаблоны"
-
-#: panels/templates/panel.py:146
-#, python-format
-msgid "Templates (%(num_templates)s rendered)"
-msgstr "Шаблоны (обработано %(num_templates)s)"
-
 #: templates/debug_toolbar/base.html:19
 msgid "Hide toolbar"
 msgstr "Скрыть панель"
@@ -275,21 +276,6 @@ msgstr "Включить для последующих запросов"
 msgid "Show toolbar"
 msgstr "Показать панель"
 
-#: templates/debug_toolbar/base.html:53
-msgid "Close"
-msgstr "Закрыть"
-
-#: templates/debug_toolbar/redirect.html:8
-msgid "Location:"
-msgstr ""
-
-#: templates/debug_toolbar/redirect.html:10
-msgid ""
-"The Django Debug Toolbar has intercepted a redirect to the above URL for "
-"debug viewing purposes. You can click the above link to continue with the "
-"redirect as normal."
-msgstr "Django Debug Toolbar в перехватил редирект на адрес, указанный выше. Вы можете нажать на ссылку, чтобы выполнить переход самостоятельно."
-
 #: templates/debug_toolbar/panels/cache.html:2
 msgid "Summary"
 msgstr "Сводка"
@@ -304,11 +290,11 @@ msgstr "Общее время"
 
 #: templates/debug_toolbar/panels/cache.html:8
 msgid "Cache hits"
-msgstr "Cache хитов"
+msgstr "Попадания"
 
 #: templates/debug_toolbar/panels/cache.html:9
 msgid "Cache misses"
-msgstr "Промахи кэша"
+msgstr "Промахи"
 
 #: templates/debug_toolbar/panels/cache.html:21
 msgid "Commands"
@@ -319,7 +305,7 @@ msgid "Calls"
 msgstr "Вызовы"
 
 #: templates/debug_toolbar/panels/cache.html:43
-#: templates/debug_toolbar/panels/sql.html:20
+#: templates/debug_toolbar/panels/sql.html:23
 msgid "Time (ms)"
 msgstr "Время (мс)"
 
@@ -375,7 +361,9 @@ msgstr "WSGI-окружение"
 msgid ""
 "Since the WSGI environ inherits the environment of the server, only a "
 "significant subset is shown below."
-msgstr "Так как WSGI-окружение наследует окружение сервера, ниже отображены лишь те из переменных, которые важны для нужд отладки."
+msgstr ""
+"Так как WSGI-окружение наследует окружение сервера, ниже отображены лишь те "
+"из переменных, которые важны для нужд отладки."
 
 #: templates/debug_toolbar/panels/logging.html:6
 msgid "Level"
@@ -390,7 +378,7 @@ msgid "Message"
 msgstr "Сообщение"
 
 #: templates/debug_toolbar/panels/logging.html:10
-#: templates/debug_toolbar/panels/staticfiles.html:45
+#: templates/debug_toolbar/panels/staticfiles.html:44
 msgid "Location"
 msgstr "Место"
 
@@ -421,19 +409,19 @@ msgstr "Кол-во"
 
 #: templates/debug_toolbar/panels/request.html:3
 msgid "View information"
-msgstr "View"
+msgstr "Информация о представлении"
 
 #: templates/debug_toolbar/panels/request.html:7
 msgid "View function"
-msgstr "View функция"
+msgstr "Функция представления"
 
 #: templates/debug_toolbar/panels/request.html:10
 msgid "URL name"
-msgstr "URL Name"
+msgstr "Имя URL"
 
 #: templates/debug_toolbar/panels/request.html:24
 msgid "Cookies"
-msgstr "Cookies"
+msgstr "Куки"
 
 #: templates/debug_toolbar/panels/request.html:32
 #: templates/debug_toolbar/panels/request.html:58
@@ -444,7 +432,7 @@ msgstr "Переменная"
 
 #: templates/debug_toolbar/panels/request.html:46
 msgid "No cookies"
-msgstr "Нет cookies"
+msgstr "Нет куков"
 
 #: templates/debug_toolbar/panels/request.html:50
 msgid "Session data"
@@ -480,7 +468,7 @@ msgstr "Сигнал"
 
 #: templates/debug_toolbar/panels/signals.html:6
 msgid "Providing"
-msgstr ""
+msgstr "Аргументы"
 
 #: templates/debug_toolbar/panels/signals.html:7
 msgid "Receivers"
@@ -494,45 +482,49 @@ msgstr[0] "%(num)s запрос"
 msgstr[1] "%(num)s запроса"
 msgstr[2] "%(num)s запросов"
 
-#: templates/debug_toolbar/panels/sql.html:18
+#: templates/debug_toolbar/panels/sql.html:9
+#, python-format
+msgid "including %(dupes)s duplicates"
+msgstr "включая дублей: %(dupes)s"
+
+#: templates/debug_toolbar/panels/sql.html:21
 msgid "Query"
 msgstr "Запрос"
 
-#: templates/debug_toolbar/panels/sql.html:19
+#: templates/debug_toolbar/panels/sql.html:22
 #: templates/debug_toolbar/panels/timer.html:36
 msgid "Timeline"
 msgstr "Временная диаграмма"
 
-#: templates/debug_toolbar/panels/sql.html:21
+#: templates/debug_toolbar/panels/sql.html:24
 msgid "Action"
 msgstr "Действие"
 
-#: templates/debug_toolbar/panels/sql.html:64
+#: templates/debug_toolbar/panels/sql.html:41
+#, python-format
+msgid "Duplicated %(dupes)s times."
+msgstr "Дублей: %(dupes)s."
+
+#: templates/debug_toolbar/panels/sql.html:73
 msgid "Connection:"
 msgstr "Соединение:"
 
-#: templates/debug_toolbar/panels/sql.html:66
+#: templates/debug_toolbar/panels/sql.html:75
 msgid "Isolation level:"
 msgstr "Уровень изоляции:"
 
-#: templates/debug_toolbar/panels/sql.html:69
+#: templates/debug_toolbar/panels/sql.html:78
 msgid "Transaction status:"
 msgstr "Статус транзакции:"
 
-#: templates/debug_toolbar/panels/sql.html:83
+#: templates/debug_toolbar/panels/sql.html:92
 msgid "(unknown)"
 msgstr "(неизвестно)"
 
-#: templates/debug_toolbar/panels/sql.html:92
+#: templates/debug_toolbar/panels/sql.html:101
 msgid "No SQL queries were recorded during this request."
-msgstr "Во время обработки этого HTTP-запроса не было записано ни одного SQL-запроса."
-
-#: templates/debug_toolbar/panels/sql_explain.html:3
-#: templates/debug_toolbar/panels/sql_profile.html:3
-#: templates/debug_toolbar/panels/sql_select.html:3
-#: templates/debug_toolbar/panels/template_source.html:3
-msgid "Back"
-msgstr "Назад"
+msgstr ""
+"Во время обработки этого HTTP-запроса не было записано ни одного SQL-запроса."
 
 #: templates/debug_toolbar/panels/sql_explain.html:4
 msgid "SQL explained"
@@ -566,52 +558,52 @@ msgstr "Выбранные SQL-запросы"
 msgid "Empty set"
 msgstr "Ничего, ноль строк"
 
-#: templates/debug_toolbar/panels/staticfiles.html:4
+#: templates/debug_toolbar/panels/staticfiles.html:3
 msgid "Static file path"
 msgid_plural "Static file paths"
-msgstr[0] ""
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "Путь к статике"
+msgstr[1] "Пути к статике"
+msgstr[2] "Пути к статике"
 
-#: templates/debug_toolbar/panels/staticfiles.html:8
+#: templates/debug_toolbar/panels/staticfiles.html:7
 #, python-format
 msgid "(prefix %(prefix)s)"
-msgstr ""
+msgstr "(префикс %(prefix)s)"
 
-#: templates/debug_toolbar/panels/staticfiles.html:12
-#: templates/debug_toolbar/panels/staticfiles.html:23
-#: templates/debug_toolbar/panels/staticfiles.html:35
+#: templates/debug_toolbar/panels/staticfiles.html:11
+#: templates/debug_toolbar/panels/staticfiles.html:22
+#: templates/debug_toolbar/panels/staticfiles.html:34
 #: templates/debug_toolbar/panels/templates.html:10
 #: templates/debug_toolbar/panels/templates.html:28
 #: templates/debug_toolbar/panels/templates.html:43
 msgid "None"
 msgstr "Нет"
 
-#: templates/debug_toolbar/panels/staticfiles.html:15
+#: templates/debug_toolbar/panels/staticfiles.html:14
 msgid "Static file app"
 msgid_plural "Static file apps"
-msgstr[0] ""
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "Приложение со статикой"
+msgstr[1] "Приложения со статикой"
+msgstr[2] "Приложения со статикой"
 
-#: templates/debug_toolbar/panels/staticfiles.html:26
+#: templates/debug_toolbar/panels/staticfiles.html:25
 msgid "Static file"
 msgid_plural "Static files"
-msgstr[0] ""
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "Файл статики"
+msgstr[1] "Файлы статики"
+msgstr[2] "Файлы статики"
 
-#: templates/debug_toolbar/panels/staticfiles.html:40
+#: templates/debug_toolbar/panels/staticfiles.html:39
 #, python-format
 msgid "%(payload_count)s file"
 msgid_plural "%(payload_count)s files"
-msgstr[0] ""
-msgstr[1] ""
-msgstr[2] ""
+msgstr[0] "%(payload_count)s файл"
+msgstr[1] "%(payload_count)s файла"
+msgstr[2] "%(payload_count)s файлов"
 
-#: templates/debug_toolbar/panels/staticfiles.html:44
+#: templates/debug_toolbar/panels/staticfiles.html:43
 msgid "Path"
-msgstr ""
+msgstr "Путь"
 
 #: templates/debug_toolbar/panels/template_source.html:4
 msgid "Template source:"
@@ -663,10 +655,41 @@ msgstr "Событие"
 msgid "Milliseconds since navigation start (+length)"
 msgstr "С начала навигации в мс (+продолжительность)"
 
-#: templates/debug_toolbar/panels/versions.html:5
+#: templates/debug_toolbar/panels/versions.html:7
+msgid "Package"
+msgstr "Пакет"
+
+#: templates/debug_toolbar/panels/versions.html:8
 msgid "Name"
 msgstr "Название"
 
-#: templates/debug_toolbar/panels/versions.html:6
+#: templates/debug_toolbar/panels/versions.html:9
 msgid "Version"
 msgstr "Версия"
+
+#: templates/debug_toolbar/redirect.html:8
+msgid "Location:"
+msgstr "Место:"
+
+#: templates/debug_toolbar/redirect.html:10
+msgid ""
+"The Django Debug Toolbar has intercepted a redirect to the above URL for "
+"debug viewing purposes. You can click the above link to continue with the "
+"redirect as normal."
+msgstr ""
+"Django Debug Toolbar перехватил перенаправление на адрес, указанный выше. Вы "
+"можете нажать на ссылку, чтобы выполнить переход самостоятельно."
+
+#: views.py:14
+msgid ""
+"Data for this panel isn't available anymore. Please reload the page and "
+"retry."
+msgstr ""
+"Данные этой панели больше недоступны. Пожалуйста, перезагрузите страницу и "
+"попробуйте ещё раз."
+
+#~ msgid "Close"
+#~ msgstr "Закрыть"
+
+#~ msgid "Back"
+#~ msgstr "Назад"

+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/sk/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/sk/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/sk/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/sk/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/uk/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/uk/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/uk/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/uk/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.mo → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.mo


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.po → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.po


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/management/__init__.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/management/__init__.py


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/management/commands/__init__.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/management/commands/__init__.py


+ 5 - 7
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/management/commands/debugsqlshell.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/management/commands/debugsqlshell.py

@@ -2,15 +2,13 @@ from __future__ import absolute_import, print_function, unicode_literals
 
 from time import time
 
-# 'debugsqlshell' is the same as the 'shell'.
-from django.core.management.commands.shell import Command               # noqa
-
 import sqlparse
-
-from debug_toolbar.compat import db_backends_util
+# 'debugsqlshell' is the same as the 'shell'.
+from django.core.management.commands.shell import Command  # noqa
+from django.db.backends import utils as db_backends_utils
 
 
-class PrintQueryWrapper(db_backends_util.CursorDebugWrapper):
+class PrintQueryWrapper(db_backends_utils.CursorDebugWrapper):
     def execute(self, sql, params=()):
         start_time = time()
         try:
@@ -23,4 +21,4 @@ class PrintQueryWrapper(db_backends_util.CursorDebugWrapper):
             print('%s [%.2fms]' % (formatted_sql, duration))
 
 
-db_backends_util.CursorDebugWrapper = PrintQueryWrapper
+db_backends_utils.CursorDebugWrapper = PrintQueryWrapper

+ 37 - 32
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/middleware.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/middleware.py

@@ -8,16 +8,22 @@ import re
 import threading
 
 from django.conf import settings
-from django.utils.encoding import force_text
 from django.utils import six
+from django.utils.encoding import force_text
+from django.utils.lru_cache import lru_cache
+from django.utils.module_loading import import_string
 
-from debug_toolbar.toolbar import DebugToolbar
 from debug_toolbar import settings as dt_settings
-from debug_toolbar.compat import import_module
+from debug_toolbar.toolbar import DebugToolbar
+
+try:
+    from django.utils.deprecation import MiddlewareMixin
+except ImportError:  # Django < 1.10
+    # Works perfectly for everyone using MIDDLEWARE_CLASSES
+    MiddlewareMixin = object
+
 
 _HTML_TYPES = ('text/html', 'application/xhtml+xml')
-# Handles python threading module bug - http://bugs.python.org/issue14308
-threading._DummyThread._Thread__stop = lambda x: 1
 
 
 def show_toolbar(request):
@@ -27,33 +33,35 @@ def show_toolbar(request):
     if request.META.get('REMOTE_ADDR', None) not in settings.INTERNAL_IPS:
         return False
 
-    if request.is_ajax():
-        return False
-
     return bool(settings.DEBUG)
 
 
-class DebugToolbarMiddleware(object):
+@lru_cache()
+def get_show_toolbar():
+    # If SHOW_TOOLBAR_CALLBACK is a string, which is the recommended
+    # setup, resolve it to the corresponding callable.
+    func_or_path = dt_settings.get_config()['SHOW_TOOLBAR_CALLBACK']
+    if isinstance(func_or_path, six.string_types):
+        return import_string(func_or_path)
+    else:
+        return func_or_path
+
+
+class DebugToolbarMiddleware(MiddlewareMixin):
     """
     Middleware to set up Debug Toolbar on incoming request and render toolbar
     on outgoing response.
     """
     debug_toolbars = {}
 
-    def __init__(self):
-        # If SHOW_TOOLBAR_CALLBACK is a string, which is the recommended
-        # setup, resolve it to the corresponding callable.
-        func_or_path = dt_settings.CONFIG['SHOW_TOOLBAR_CALLBACK']
-        if isinstance(func_or_path, six.string_types):
-            # Replace this with import_by_path in Django >= 1.6.
-            mod_path, func_name = func_or_path.rsplit('.', 1)
-            self.show_toolbar = getattr(import_module(mod_path), func_name)
-        else:
-            self.show_toolbar = func_or_path
-
     def process_request(self, request):
         # Decide whether the toolbar is active for this request.
-        if not self.show_toolbar(request):
+        show_toolbar = get_show_toolbar()
+        if not show_toolbar(request):
+            return
+
+        # Don't render the toolbar during AJAX requests.
+        if request.is_ajax():
             return
 
         toolbar = DebugToolbar(request)
@@ -114,18 +122,15 @@ class DebugToolbarMiddleware(object):
             response.set_cookie('djdt', 'hide', 864000)
 
         # Insert the toolbar in the response.
-        content = force_text(response.content, encoding=settings.DEFAULT_CHARSET)
-        insert_before = dt_settings.CONFIG['INSERT_BEFORE']
-        try:                    # Python >= 2.7
-            pattern = re.escape(insert_before)
-            bits = re.split(pattern, content, flags=re.IGNORECASE)
-        except TypeError:       # Python < 2.7
-            pattern = '(.+?)(%s|$)' % re.escape(insert_before)
-            matches = re.findall(pattern, content, flags=re.DOTALL | re.IGNORECASE)
-            bits = [m[0] for m in matches if m[1] == insert_before]
-            # When the body ends with a newline, there's two trailing groups.
-            bits.append(''.join(m[0] for m in matches if m[1] == ''))
+        content = force_text(response.content, encoding=response.charset)
+        insert_before = dt_settings.get_config()['INSERT_BEFORE']
+        pattern = re.escape(insert_before)
+        bits = re.split(pattern, content, flags=re.IGNORECASE)
         if len(bits) > 1:
+            # When the toolbar will be inserted for sure, generate the stats.
+            for panel in reversed(toolbar.enabled_panels):
+                panel.generate_stats(request, response)
+
             bits[-2] += toolbar.render_toolbar()
             response.content = insert_before.join(bits)
             if response.get('Content-Length', None):

+ 21 - 2
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/__init__.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/__init__.py

@@ -24,7 +24,7 @@ class Panel(object):
     @property
     def enabled(self):
         # Check to see if settings has a default value for it
-        disabled_panels = dt_settings.CONFIG['DISABLE_PANELS']
+        disabled_panels = dt_settings.get_config()['DISABLE_PANELS']
         panel_path = get_name_from_obj(self)
         # Some panels such as the SQLPanel and TemplatesPanel exist in a
         # panel module, but can be disabled without panel in the path.
@@ -167,10 +167,29 @@ class Panel(object):
 
     def process_response(self, request, response):
         """
-        Like process_response in Django's middleware.
+        Like process_response in Django's middleware. This is similar to
+        :meth:`generate_stats <debug_toolbar.panels.Panel.generate_stats>`,
+        but will be executed on every request. It should be used when either
+        the logic needs to be executed on every request or it needs to change
+        the response entirely, such as :class:`RedirectsPanel`.
 
         Write panel logic related to the response there. Post-process data
         gathered while the view executed. Save data with :meth:`record_stats`.
+
+        Return a response to overwrite the existing response.
+        """
+
+    def generate_stats(self, request, response):
+        """
+        Similar to :meth:`process_response
+        <debug_toolbar.panels.Panel.process_response>`,
+        but may not be executed on every request. This will only be called if
+        the toolbar will be inserted into the request.
+
+        Write panel logic related to the response there. Post-process data
+        gathered while the view executed. Save data with :meth:`record_stats`.
+
+        Does not return a value.
         """
 
 

+ 33 - 42
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/cache.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/cache.py

@@ -3,25 +3,25 @@ from __future__ import absolute_import, unicode_literals
 import inspect
 import sys
 import time
+from collections import OrderedDict
 
+import django
 from django.conf import settings
 from django.core import cache
-from django.core.cache import (
-    cache as original_cache,
-    get_cache as original_get_cache)
+from django.core.cache import CacheHandler, caches as original_caches
 from django.core.cache.backends.base import BaseCache
 from django.dispatch import Signal
 from django.middleware import cache as middleware_cache
 from django.utils.translation import ugettext_lazy as _, ungettext
 
-
 from debug_toolbar import settings as dt_settings
-from debug_toolbar.compat import (
-    OrderedDict, CacheHandler, caches as original_caches)
 from debug_toolbar.panels import Panel
-from debug_toolbar.utils import (tidy_stacktrace, render_stacktrace,
-                                 get_template_info, get_stack)
+from debug_toolbar.utils import (
+    get_stack, get_template_info, render_stacktrace, tidy_stacktrace,
+)
 
+if django.VERSION[:2] < (1, 9):
+    from django.core.cache import get_cache as original_get_cache
 
 cache_called = Signal(providing_args=[
     "time_taken", "name", "return_value", "args", "kwargs", "trace"])
@@ -33,7 +33,7 @@ def send_signal(method):
         value = method(self, *args, **kwargs)
         t = time.time() - t
 
-        if dt_settings.CONFIG['ENABLE_STACKTRACES']:
+        if dt_settings.get_config()['ENABLE_STACKTRACES']:
             stacktrace = tidy_stacktrace(reversed(get_stack()))
         else:
             stacktrace = []
@@ -121,21 +121,15 @@ class CacheStatTracker(BaseCache):
         return self.cache.decr_version(*args, **kwargs)
 
 
-def get_cache(*args, **kwargs):
-    return CacheStatTracker(original_get_cache(*args, **kwargs))
-
-
-if CacheHandler is not None:
-    class CacheHandlerPatch(CacheHandler):
-        def __getitem__(self, alias):
-            actual_cache = super(CacheHandlerPatch, self).__getitem__(alias)
-            return CacheStatTracker(actual_cache)
+if django.VERSION[:2] < (1, 9):
+    def get_cache(*args, **kwargs):
+        return CacheStatTracker(original_get_cache(*args, **kwargs))
 
 
-def get_cache_handler():
-    if CacheHandler is None:
-        return None
-    return CacheHandlerPatch()
+class CacheHandlerPatch(CacheHandler):
+    def __getitem__(self, alias):
+        actual_cache = super(CacheHandlerPatch, self).__getitem__(alias)
+        return CacheStatTracker(actual_cache)
 
 
 # Must monkey patch the middleware's cache module as well in order to
@@ -143,8 +137,9 @@ def get_cache_handler():
 # of the enable_instrumentation method since the django's
 # decorator_from_middleware_with_args will store the cache from core.caches
 # when it wraps the view.
-middleware_cache.get_cache = get_cache
-middleware_cache.caches = get_cache_handler()
+if django.VERSION[:2] < (1, 9):
+    middleware_cache.get_cache = get_cache
+middleware_cache.caches = CacheHandlerPatch()
 
 
 class CachePanel(Panel):
@@ -224,27 +219,23 @@ class CachePanel(Panel):
                          count) % dict(count=count)
 
     def enable_instrumentation(self):
-        cache.get_cache = get_cache
-        if CacheHandler is None:
-            cache.cache = CacheStatTracker(original_cache)
+        if django.VERSION[:2] < (1, 9):
+            cache.get_cache = get_cache
+        if isinstance(middleware_cache.caches, CacheHandlerPatch):
+            cache.caches = middleware_cache.caches
         else:
-            if isinstance(middleware_cache.caches, CacheHandlerPatch):
-                cache.caches = middleware_cache.caches
-            else:
-                cache.caches = get_cache_handler()
+            cache.caches = CacheHandlerPatch()
 
     def disable_instrumentation(self):
-        if CacheHandler is None:
-            cache.cache = original_cache
-        else:
-            cache.caches = original_caches
-            # While it can be restored to the original, any views that were
-            # wrapped with the cache_page decorator will continue to use a
-            # monkey patched cache.
-            middleware_cache.caches = original_caches
-        cache.get_cache = original_get_cache
-
-    def process_response(self, request, response):
+        if django.VERSION[:2] < (1, 9):
+            cache.get_cache = original_get_cache
+        cache.caches = original_caches
+        # While it can be restored to the original, any views that were
+        # wrapped with the cache_page decorator will continue to use a
+        # monkey patched cache.
+        middleware_cache.caches = original_caches
+
+    def generate_stats(self, request, response):
         self.record_stats({
             'total_calls': len(self.calls),
             'calls': self.calls,

+ 3 - 2
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/headers.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/headers.py

@@ -1,8 +1,9 @@
 from __future__ import absolute_import, unicode_literals
 
+from collections import OrderedDict
+
 from django.utils.translation import ugettext_lazy as _
 
-from debug_toolbar.compat import OrderedDict
 from debug_toolbar.panels import Panel
 
 
@@ -47,7 +48,7 @@ class HeadersPanel(Panel):
             'environ': self.environ,
         })
 
-    def process_response(self, request, response):
+    def generate_stats(self, request, response):
         self.response_headers = OrderedDict(sorted(response.items()))
         self.record_stats({
             'response_headers': self.response_headers,

+ 7 - 4
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/logging.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/logging.py

@@ -2,13 +2,16 @@ from __future__ import absolute_import, unicode_literals
 
 import datetime
 import logging
+
+from django.utils.translation import ugettext_lazy as _, ungettext
+
+from debug_toolbar.panels import Panel
+from debug_toolbar.utils import ThreadCollector
+
 try:
     import threading
 except ImportError:
     threading = None
-from django.utils.translation import ungettext, ugettext_lazy as _
-from debug_toolbar.panels import Panel
-from debug_toolbar.utils import ThreadCollector
 
 MESSAGE_IF_STRING_REPRESENTATION_INVALID = '[Could not get log message]'
 
@@ -74,7 +77,7 @@ class LoggingPanel(Panel):
     def process_request(self, request):
         collector.clear_collection()
 
-    def process_response(self, request, response):
+    def generate_stats(self, request, response):
         records = collector.get_collection()
         self._records[threading.currentThread()] = records
         collector.clear_collection()

+ 41 - 23
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/profiling.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/profiling.py

@@ -1,14 +1,31 @@
 from __future__ import absolute_import, division, unicode_literals
 
+import cProfile
+import os
+from colorsys import hsv_to_rgb
+from pstats import Stats
+
+from django.utils import six
+from django.utils.html import format_html
 from django.utils.translation import ugettext_lazy as _
-from django.utils.safestring import mark_safe
-from debug_toolbar.panels import Panel
+
 from debug_toolbar import settings as dt_settings
+from debug_toolbar.panels import Panel
 
-import cProfile
-from pstats import Stats
-from colorsys import hsv_to_rgb
-import os
+# Occasionally the disable method on the profiler is listed before
+# the actual view functions. This function call should be ignored as
+# it leads to an error within the tests.
+INVALID_PROFILER_FUNC = '_lsprof.Profiler'
+
+
+def contains_profiler(func_tuple):
+    """Helper function that checks to see if the tuple contains
+    the INVALID_PROFILE_FUNC in any string value of the tuple."""
+    has_profiler = False
+    for value in func_tuple:
+        if isinstance(value, six.string_types):
+            has_profiler |= INVALID_PROFILER_FUNC in value
+    return has_profiler
 
 
 class DjangoDebugToolbarStats(Stats):
@@ -17,7 +34,7 @@ class DjangoDebugToolbarStats(Stats):
     def get_root_func(self):
         if self.__root is None:
             for func, (cc, nc, tt, ct, callers) in self.stats.items():
-                if len(callers) == 0:
+                if len(callers) == 0 and not contains_profiler(func):
                     self.__root = func
                     break
         return self.__root
@@ -61,15 +78,15 @@ class FunctionCall(object):
 
             file_path, file_name = file_name.rsplit(os.sep, 1)
 
-            return mark_safe(
+            return format_html(
                 '<span class="djdt-path">{0}/</span>'
                 '<span class="djdt-file">{1}</span>'
                 ' in <span class="djdt-func">{3}</span>'
-                '(<span class="djdt-lineno">{2}</span>)'.format(
-                    file_path,
-                    file_name,
-                    line_num,
-                    method))
+                '(<span class="djdt-lineno">{2}</span>)',
+                file_path,
+                file_name,
+                line_num,
+                method)
 
     def subfuncs(self):
         i = 0
@@ -142,7 +159,7 @@ class ProfilingPanel(Panel):
                     func.has_subfuncs = True
                     self.add_node(func_list, subfunc, max_depth, cum_time=cum_time)
 
-    def process_response(self, request, response):
+    def generate_stats(self, request, response):
         if not hasattr(self, 'profiler'):
             return None
         # Could be delayed until the panel content is requested (perf. optim.)
@@ -150,12 +167,13 @@ class ProfilingPanel(Panel):
         self.stats = DjangoDebugToolbarStats(self.profiler)
         self.stats.calc_callees()
 
-        root = FunctionCall(self.stats, self.stats.get_root_func(), depth=0)
-
-        func_list = []
-        self.add_node(func_list,
-                      root,
-                      dt_settings.CONFIG['PROFILER_MAX_DEPTH'],
-                      root.stats[3] / 8)
-
-        self.record_stats({'func_list': func_list})
+        root_func = self.stats.get_root_func()
+        # Ensure root function exists before continuing with function call analysis
+        if root_func:
+            root = FunctionCall(self.stats, root_func, depth=0)
+            func_list = []
+            self.add_node(func_list,
+                          root,
+                          dt_settings.get_config()['PROFILER_MAX_DEPTH'],
+                          root.stats[3] / 8)
+            self.record_stats({'func_list': func_list})

+ 5 - 9
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/redirects.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/redirects.py

@@ -1,7 +1,6 @@
 from __future__ import absolute_import, unicode_literals
 
-from django.core.handlers.wsgi import STATUS_CODE_TEXT
-from django.shortcuts import render_to_response
+from django.template.response import SimpleTemplateResponse
 from django.utils.translation import ugettext_lazy as _
 
 from debug_toolbar.panels import Panel
@@ -20,14 +19,11 @@ class RedirectsPanel(Panel):
         if 300 <= int(response.status_code) < 400:
             redirect_to = response.get('Location', None)
             if redirect_to:
-                try:        # Django >= 1.6
-                    reason_phrase = response.reason_phrase
-                except AttributeError:
-                    reason_phrase = STATUS_CODE_TEXT.get(response.status_code,
-                                                         'UNKNOWN STATUS CODE')
-                status_line = '%s %s' % (response.status_code, reason_phrase)
+                status_line = '%s %s' % (response.status_code, response.reason_phrase)
                 cookies = response.cookies
                 context = {'redirect_to': redirect_to, 'status_line': status_line}
-                response = render_to_response('debug_toolbar/redirect.html', context)
+                # Using SimpleTemplateResponse avoids running global context processors.
+                response = SimpleTemplateResponse('debug_toolbar/redirect.html', context)
                 response.cookies = cookies
+                response.render()
         return response

+ 6 - 2
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/request.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/request.py

@@ -1,6 +1,5 @@
 from __future__ import absolute_import, unicode_literals
 
-from django.core.urlresolvers import resolve
 from django.http import Http404
 from django.utils.encoding import force_text
 from django.utils.translation import ugettext_lazy as _
@@ -8,6 +7,11 @@ from django.utils.translation import ugettext_lazy as _
 from debug_toolbar.panels import Panel
 from debug_toolbar.utils import get_name_from_obj
 
+try:
+    from django.urls import resolve
+except ImportError:  # Django < 1.10 pragma: no cover
+    from django.core.urlresolvers import resolve
+
 
 class RequestPanel(Panel):
     """
@@ -25,7 +29,7 @@ class RequestPanel(Panel):
         view_func = self.get_stats().get('view_func', '')
         return view_func.rsplit('.', 1)[-1]
 
-    def process_response(self, request, response):
+    def generate_stats(self, request, response):
         self.record_stats({
             'get': [(k, request.GET.getlist(k)) for k in sorted(request.GET)],
             'post': [(k, request.POST.getlist(k)) for k in sorted(request.POST)],

+ 4 - 3
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/settings.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/settings.py

@@ -1,10 +1,11 @@
 from __future__ import absolute_import, unicode_literals
 
+from collections import OrderedDict
+
 from django.conf import settings
-from django.views.debug import get_safe_settings
 from django.utils.translation import ugettext_lazy as _
+from django.views.debug import get_safe_settings
 
-from debug_toolbar.compat import OrderedDict
 from debug_toolbar.panels import Panel
 
 
@@ -19,7 +20,7 @@ class SettingsPanel(Panel):
     def title(self):
         return _("Settings from <code>%s</code>") % settings.SETTINGS_MODULE
 
-    def process_response(self, request, response):
+    def generate_stats(self, request, response):
         self.record_stats({
             'settings': OrderedDict(sorted(get_safe_settings().items(),
                                            key=lambda s: s[0])),

+ 12 - 13
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/signals.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/signals.py

@@ -1,17 +1,19 @@
 from __future__ import absolute_import, unicode_literals
 
+import weakref
 
 from django.core.signals import (
-    request_started, request_finished, got_request_exception)
+    got_request_exception, request_finished, request_started,
+)
 from django.db.backends.signals import connection_created
 from django.db.models.signals import (
-    class_prepared, pre_init, post_init, pre_save, post_save,
-    pre_delete, post_delete, post_syncdb)
-
+    class_prepared, post_delete, post_init, post_migrate, post_save,
+    pre_delete, pre_init, pre_save,
+)
+from django.utils.module_loading import import_string
 from django.utils.translation import ugettext_lazy as _, ungettext
 
 from debug_toolbar.panels import Panel
-from debug_toolbar.compat import import_module, WEAKREF_TYPES
 
 
 class SignalsPanel(Panel):
@@ -29,7 +31,7 @@ class SignalsPanel(Panel):
         'post_save': post_save,
         'pre_delete': pre_delete,
         'post_delete': post_delete,
-        'post_syncdb': post_syncdb,
+        'post_migrate': post_migrate,
     }
 
     def nav_subtitle(self):
@@ -53,20 +55,17 @@ class SignalsPanel(Panel):
     def signals(self):
         signals = self.SIGNALS.copy()
         for signal in self.toolbar.config['EXTRA_SIGNALS']:
-            mod_path, signal_name = signal.rsplit('.', 1)
-            signals_mod = import_module(mod_path)
-            signals[signal_name] = getattr(signals_mod, signal_name)
+            signal_name = signal.rsplit('.', 1)[-1]
+            signals[signal_name] = import_string(signal)
         return signals
 
-    def process_response(self, request, response):
+    def generate_stats(self, request, response):
         signals = []
         for name, signal in sorted(self.signals.items(), key=lambda x: x[0]):
-            if signal is None:
-                continue
             receivers = []
             for receiver in signal.receivers:
                 receiver = receiver[1]
-                if isinstance(receiver, WEAKREF_TYPES):
+                if isinstance(receiver, weakref.ReferenceType):
                     receiver = receiver()
                 if receiver is None:
                     continue

+ 1 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/__init__.py

@@ -0,0 +1 @@
+from debug_toolbar.panels.sql.panel import SQLPanel  # noqa

+ 10 - 9
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/sql/forms.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/forms.py

@@ -1,14 +1,16 @@
 from __future__ import absolute_import, unicode_literals
 
-import json
 import hashlib
+import hmac
+import json
 
 from django import forms
 from django.conf import settings
+from django.core.exceptions import ValidationError
 from django.db import connections
-from django.utils.encoding import force_text
+from django.utils.crypto import constant_time_compare
+from django.utils.encoding import force_bytes
 from django.utils.functional import cached_property
-from django.core.exceptions import ValidationError
 
 from debug_toolbar.panels.sql.utils import reformat_sql
 
@@ -68,7 +70,7 @@ class SQLSelectForm(forms.Form):
     def clean_hash(self):
         hash = self.cleaned_data['hash']
 
-        if hash != self.make_hash(self.data):
+        if not constant_time_compare(hash, self.make_hash(self.data)):
             raise ValidationError('Tamper alert')
 
         return hash
@@ -77,11 +79,10 @@ class SQLSelectForm(forms.Form):
         return reformat_sql(self.cleaned_data['sql'])
 
     def make_hash(self, data):
-        items = [settings.SECRET_KEY, data['sql'], data['params']]
-        # Replace lines endings with spaces to preserve the hash value
-        # even when the browser normalizes \r\n to \n in inputs.
-        items = [' '.join(force_text(item).splitlines()) for item in items]
-        return hashlib.sha1(''.join(items).encode('utf-8')).hexdigest()
+        m = hmac.new(key=force_bytes(settings.SECRET_KEY), digestmod=hashlib.sha1)
+        for item in [data['sql'], data['params']]:
+            m.update(force_bytes(item))
+        return m.hexdigest()
 
     @property
     def connection(self):

+ 18 - 14
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/sql/panel.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/panel.py

@@ -1,19 +1,21 @@
 from __future__ import absolute_import, unicode_literals
 
 import uuid
-from copy import copy
 from collections import defaultdict
+from copy import copy
 
 from django.conf.urls import url
 from django.db import connections
 from django.utils.translation import ugettext_lazy as _, ungettext_lazy as __
 
 from debug_toolbar.panels import Panel
+from debug_toolbar.panels.sql import views
 from debug_toolbar.panels.sql.forms import SQLSelectForm
+from debug_toolbar.panels.sql.tracking import unwrap_cursor, wrap_cursor
+from debug_toolbar.panels.sql.utils import (
+    contrasting_color_generator, reformat_sql,
+)
 from debug_toolbar.utils import render_stacktrace
-from debug_toolbar.panels.sql.utils import reformat_sql, contrasting_color_generator
-from debug_toolbar.panels.sql.tracking import wrap_cursor, unwrap_cursor
-from debug_toolbar.panels.sql import views
 
 
 def get_isolation_level_display(vendor, level):
@@ -53,7 +55,7 @@ class SQLPanel(Panel):
     """
     def __init__(self, *args, **kwargs):
         super(SQLPanel, self).__init__(*args, **kwargs)
-        self._offset = dict((k, len(connections[k].queries)) for k in connections)
+        self._offset = {k: len(connections[k].queries) for k in connections}
         self._sql_time = 0
         self._num_queries = 0
         self._queries = []
@@ -136,7 +138,7 @@ class SQLPanel(Panel):
         for connection in connections.all():
             unwrap_cursor(connection)
 
-    def process_response(self, request, response):
+    def generate_stats(self, request, response):
         colors = contrasting_color_generator()
         trace_colors = defaultdict(lambda: next(colors))
         query_duplicates = defaultdict(lambda: defaultdict(int))
@@ -146,7 +148,7 @@ class SQLPanel(Panel):
             for n, db in enumerate(self._databases.values()):
                 rgb = [0, 0, 0]
                 color = n % 3
-                rgb[color] = 256 - n / 3 * factor
+                rgb[color] = 256 - n // 3 * factor
                 nn = color
                 # XXX: pretty sure this is horrible after so many aliases
                 while rgb[color] < factor:
@@ -209,25 +211,27 @@ class SQLPanel(Panel):
 
         # Queries are duplicates only if there's as least 2 of them.
         # Also, to hide queries, we need to give all the duplicate groups an id
-        query_duplicates = dict(
-            (alias, dict(
-                (query, duplicate_count)
+        query_colors = contrasting_color_generator()
+        query_duplicates = {
+            alias: {
+                query: (duplicate_count, next(query_colors))
                 for query, duplicate_count in queries.items()
                 if duplicate_count >= 2
-            ))
+            }
             for alias, queries in query_duplicates.items()
-        )
+        }
 
         for alias, query in self._queries:
             try:
-                duplicates_count = query_duplicates[alias][query["raw_sql"]]
+                duplicates_count, color = query_duplicates[alias][query["raw_sql"]]
                 query["duplicate_count"] = duplicates_count
+                query["duplicate_color"] = color
             except KeyError:
                 pass
 
         for alias, alias_info in self._databases.items():
             try:
-                alias_info["duplicate_count"] = sum(e for e in query_duplicates[alias].values())
+                alias_info["duplicate_count"] = sum(e[0] for e in query_duplicates[alias].values())
             except KeyError:
                 pass
 

+ 17 - 12
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/sql/tracking.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/tracking.py

@@ -4,11 +4,11 @@ import json
 from threading import local
 from time import time
 
-from django.utils.encoding import force_text
 from django.utils import six
+from django.utils.encoding import force_text
 
-from debug_toolbar.utils import tidy_stacktrace, get_template_info, get_stack
 from debug_toolbar import settings as dt_settings
+from debug_toolbar.utils import get_stack, get_template_info, tidy_stacktrace
 
 
 class SQLQueryTriggered(Exception):
@@ -38,8 +38,14 @@ def wrap_cursor(connection, panel):
     if not hasattr(connection, '_djdt_cursor'):
         connection._djdt_cursor = connection.cursor
 
-        def cursor():
-            return state.Wrapper(connection._djdt_cursor(), connection, panel)
+        def cursor(*args, **kwargs):
+            # Per the DB API cursor() does not accept any arguments. There's
+            # some code in the wild which does not follow that convention,
+            # so we pass on the arguments even though it's not clean.
+            # See:
+            # https://github.com/jazzband/django-debug-toolbar/pull/615
+            # https://github.com/jazzband/django-debug-toolbar/pull/896
+            return state.Wrapper(connection._djdt_cursor(*args, **kwargs), connection, panel)
 
         connection.cursor = cursor
         return cursor
@@ -85,9 +91,8 @@ class NormalCursorWrapper(object):
         if not params:
             return params
         if isinstance(params, dict):
-            return dict((key, self._quote_expr(value))
-                        for key, value in params.items())
-        return list(map(self._quote_expr, params))
+            return {key: self._quote_expr(value) for key, value in params.items()}
+        return [self._quote_expr(p) for p in params]
 
     def _decode(self, param):
         try:
@@ -102,13 +107,13 @@ class NormalCursorWrapper(object):
         finally:
             stop_time = time()
             duration = (stop_time - start_time) * 1000
-            if dt_settings.CONFIG['ENABLE_STACKTRACES']:
+            if dt_settings.get_config()['ENABLE_STACKTRACES']:
                 stacktrace = tidy_stacktrace(reversed(get_stack()))
             else:
                 stacktrace = []
             _params = ''
             try:
-                _params = json.dumps(list(map(self._decode, params)))
+                _params = json.dumps([self._decode(p) for p in params])
             except Exception:
                 pass  # object not JSON serializable
 
@@ -129,7 +134,7 @@ class NormalCursorWrapper(object):
                 'stacktrace': stacktrace,
                 'start_time': start_time,
                 'stop_time': stop_time,
-                'is_slow': duration > dt_settings.CONFIG['SQL_WARNING_THRESHOLD'],
+                'is_slow': duration > dt_settings.get_config()['SQL_WARNING_THRESHOLD'],
                 'is_select': sql.lower().strip().startswith('select'),
                 'template_info': template_info,
             }
@@ -152,10 +157,10 @@ class NormalCursorWrapper(object):
             # We keep `sql` to maintain backwards compatibility
             self.logger.record(**params)
 
-    def callproc(self, procname, params=()):
+    def callproc(self, procname, params=None):
         return self._record(self.cursor.callproc, procname, params)
 
-    def execute(self, sql, params=()):
+    def execute(self, sql, params=None):
         return self._record(self.cursor.execute, sql, params)
 
     def executemany(self, sql, param_list):

+ 1 - 4
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/sql/utils.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/utils.py

@@ -2,16 +2,13 @@ from __future__ import absolute_import, unicode_literals
 
 import re
 
-from django.utils.html import escape
-
 import sqlparse
+from django.utils.html import escape
 from sqlparse import tokens as T
 
 
 class BoldKeywordFilter:
     """sqlparse filter to bold SQL keywords"""
-    # https://github.com/jazzband/django-debug-toolbar/issues/852
-    # fix: https://github.com/jazzband/django-debug-toolbar/commit/3e7b0e0842e36483841c862cb3412f26a3b1156f
     def process(self, stream):
         """Process the token stream"""
         for token_type, value in stream:

+ 12 - 8
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/sql/views.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/sql/views.py

@@ -1,13 +1,15 @@
 from __future__ import absolute_import, unicode_literals
 
 from django.http import HttpResponseBadRequest
-from django.shortcuts import render_to_response
+from django.template.response import SimpleTemplateResponse
 from django.views.decorators.csrf import csrf_exempt
 
+from debug_toolbar.decorators import require_show_toolbar
 from debug_toolbar.panels.sql.forms import SQLSelectForm
 
 
 @csrf_exempt
+@require_show_toolbar
 def sql_select(request):
     """Returns the output of the SQL SELECT statement"""
     form = SQLSelectForm(request.POST or None)
@@ -27,12 +29,13 @@ def sql_select(request):
             'headers': headers,
             'alias': form.cleaned_data['alias'],
         }
-        # Using render_to_response avoids running global context processors.
-        return render_to_response('debug_toolbar/panels/sql_select.html', context)
+        # Using SimpleTemplateResponse avoids running global context processors.
+        return SimpleTemplateResponse('debug_toolbar/panels/sql_select.html', context)
     return HttpResponseBadRequest('Form errors')
 
 
 @csrf_exempt
+@require_show_toolbar
 def sql_explain(request):
     """Returns the output of the SQL EXPLAIN on the given query"""
     form = SQLSelectForm(request.POST or None)
@@ -46,7 +49,7 @@ def sql_explain(request):
         if vendor == 'sqlite':
             # SQLite's EXPLAIN dumps the low-level opcodes generated for a query;
             # EXPLAIN QUERY PLAN dumps a more human-readable summary
-            # See http://www.sqlite.org/lang_explain.html for details
+            # See https://www.sqlite.org/lang_explain.html for details
             cursor.execute("EXPLAIN QUERY PLAN %s" % (sql,), params)
         elif vendor == 'postgresql':
             cursor.execute("EXPLAIN ANALYZE %s" % (sql,), params)
@@ -63,12 +66,13 @@ def sql_explain(request):
             'headers': headers,
             'alias': form.cleaned_data['alias'],
         }
-        # Using render_to_response avoids running global context processors.
-        return render_to_response('debug_toolbar/panels/sql_explain.html', context)
+        # Using SimpleTemplateResponse avoids running global context processors.
+        return SimpleTemplateResponse('debug_toolbar/panels/sql_explain.html', context)
     return HttpResponseBadRequest('Form errors')
 
 
 @csrf_exempt
+@require_show_toolbar
 def sql_profile(request):
     """Returns the output of running the SQL and getting the profiling statistics"""
     form = SQLSelectForm(request.POST or None)
@@ -109,6 +113,6 @@ def sql_profile(request):
             'headers': headers,
             'alias': form.cleaned_data['alias'],
         }
-        # Using render_to_response avoids running global context processors.
-        return render_to_response('debug_toolbar/panels/sql_profile.html', context)
+        # Using SimpleTemplateResponse avoids running global context processors.
+        return SimpleTemplateResponse('debug_toolbar/panels/sql_profile.html', context)
     return HttpResponseBadRequest('Form errors')

+ 12 - 10
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/staticfiles.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/staticfiles.py

@@ -1,23 +1,24 @@
 from __future__ import absolute_import, unicode_literals
-from os.path import normpath, join
-try:
-    import threading
-except ImportError:
-    threading = None
+
+from collections import OrderedDict
+from os.path import join, normpath
 
 from django.conf import settings
-from django.core.files.storage import get_storage_class
 from django.contrib.staticfiles import finders, storage
 from django.contrib.staticfiles.templatetags import staticfiles
-
+from django.core.files.storage import get_storage_class
 from django.utils.encoding import python_2_unicode_compatible
 from django.utils.functional import LazyObject
-from django.utils.translation import ungettext, ugettext_lazy as _
+from django.utils.translation import ugettext_lazy as _, ungettext
 
 from debug_toolbar import panels
-from debug_toolbar.compat import OrderedDict
 from debug_toolbar.utils import ThreadCollector
 
+try:
+    import threading
+except ImportError:
+    threading = None
+
 
 @python_2_unicode_compatible
 class StaticFile(object):
@@ -71,6 +72,7 @@ class DebugConfiguredStorage(LazyObject):
 
         self._wrapped = DebugStaticFilesStorage(collector)
 
+
 _original_storage = storage.staticfiles_storage
 
 
@@ -113,7 +115,7 @@ class StaticFilesPanel(panels.Panel):
     def process_request(self, request):
         collector.clear_collection()
 
-    def process_response(self, request, response):
+    def generate_stats(self, request, response):
         used_paths = collector.get_collection()
         self._paths[threading.currentThread()] = used_paths
 

+ 1 - 1
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/templates/__init__.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/templates/__init__.py

@@ -1 +1 @@
-from debug_toolbar.panels.templates.panel import TemplatesPanel         # noqa
+from debug_toolbar.panels.templates.panel import TemplatesPanel  # noqa

+ 222 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/templates/panel.py

@@ -0,0 +1,222 @@
+from __future__ import absolute_import, unicode_literals
+
+from collections import OrderedDict
+from contextlib import contextmanager
+from os.path import normpath
+from pprint import pformat
+
+from django import http
+from django.conf.urls import url
+from django.core import signing
+from django.db.models.query import QuerySet, RawQuerySet
+from django.template import RequestContext, Template
+from django.test.signals import template_rendered
+from django.test.utils import instrumented_test_render
+from django.utils import six
+from django.utils.encoding import force_text
+from django.utils.translation import ugettext_lazy as _
+
+from debug_toolbar.panels import Panel
+from debug_toolbar.panels.sql.tracking import SQLQueryTriggered, recording
+from debug_toolbar.panels.templates import views
+
+# Monkey-patch to enable the template_rendered signal. The receiver returns
+# immediately when the panel is disabled to keep the overhead small.
+
+# Code taken and adapted from Simon Willison and Django Snippets:
+# https://www.djangosnippets.org/snippets/766/
+
+if Template._render != instrumented_test_render:
+    Template.original_render = Template._render
+    Template._render = instrumented_test_render
+
+
+# Monkey-patch to store items added by template context processors. The
+# overhead is sufficiently small to justify enabling it unconditionally.
+
+@contextmanager
+def _request_context_bind_template(self, template):
+    if self.template is not None:
+        raise RuntimeError("Context is already bound to a template")
+
+    self.template = template
+    # Set context processors according to the template engine's settings.
+    processors = (template.engine.template_context_processors +
+                  self._processors)
+    self.context_processors = OrderedDict()
+    updates = {}
+    for processor in processors:
+        name = '%s.%s' % (processor.__module__, processor.__name__)
+        context = processor(self.request)
+        self.context_processors[name] = context
+        updates.update(context)
+    self.dicts[self._processors_index] = updates
+
+    try:
+        yield
+    finally:
+        self.template = None
+        # Unset context processors.
+        self.dicts[self._processors_index] = {}
+
+
+RequestContext.bind_template = _request_context_bind_template
+
+
+class TemplatesPanel(Panel):
+    """
+    A panel that lists all templates used during processing of a response.
+    """
+    def __init__(self, *args, **kwargs):
+        super(TemplatesPanel, self).__init__(*args, **kwargs)
+        self.templates = []
+        # Refs GitHub issue #910
+        # Hold a series of seen dictionaries within Contexts. A dictionary is
+        # considered seen if it is `in` this list, requiring that the __eq__
+        # for the dictionary matches. If *anything* in the dictionary is
+        # different it is counted as a new layer.
+        self.seen_layers = []
+        # Holds all dictionaries which have been prettified for output.
+        # This should align with the seen_layers such that an index here is
+        # the same as the index there.
+        self.pformat_layers = []
+
+    def _store_template_info(self, sender, **kwargs):
+        template, context = kwargs['template'], kwargs['context']
+
+        # Skip templates that we are generating through the debug toolbar.
+        if (isinstance(template.name, six.string_types) and (
+            template.name.startswith('debug_toolbar/') or
+            template.name.startswith(
+                tuple(self.toolbar.config['SKIP_TEMPLATE_PREFIXES'])))):
+            return
+
+        context_list = []
+        for context_layer in context.dicts:
+            if hasattr(context_layer, 'items') and context_layer:
+                # Refs GitHub issue #910
+                # If we can find this layer in our pseudo-cache then find the
+                # matching prettified version in the associated list.
+                key_values = sorted(context_layer.items())
+                if key_values in self.seen_layers:
+                    index = self.seen_layers.index(key_values)
+                    pformatted = self.pformat_layers[index]
+                    context_list.append(pformatted)
+                else:
+                    temp_layer = {}
+                    for key, value in context_layer.items():
+                        # Replace any request elements - they have a large
+                        # unicode representation and the request data is
+                        # already made available from the Request panel.
+                        if isinstance(value, http.HttpRequest):
+                            temp_layer[key] = '<<request>>'
+                        # Replace the debugging sql_queries element. The SQL
+                        # data is already made available from the SQL panel.
+                        elif key == 'sql_queries' and isinstance(value, list):
+                            temp_layer[key] = '<<sql_queries>>'
+                        # Replace LANGUAGES, which is available in i18n context processor
+                        elif key == 'LANGUAGES' and isinstance(value, tuple):
+                            temp_layer[key] = '<<languages>>'
+                        # QuerySet would trigger the database: user can run the query from SQL Panel
+                        elif isinstance(value, (QuerySet, RawQuerySet)):
+                            model_name = "%s.%s" % (
+                                value.model._meta.app_label, value.model.__name__)
+                            temp_layer[key] = '<<%s of %s>>' % (
+                                value.__class__.__name__.lower(), model_name)
+                        else:
+                            try:
+                                recording(False)
+                                force_text(value)  # this MAY trigger a db query
+                            except SQLQueryTriggered:
+                                temp_layer[key] = '<<triggers database query>>'
+                            except UnicodeEncodeError:
+                                temp_layer[key] = '<<unicode encode error>>'
+                            except Exception:
+                                temp_layer[key] = '<<unhandled exception>>'
+                            else:
+                                temp_layer[key] = value
+                            finally:
+                                recording(True)
+                    # Refs GitHub issue #910
+                    # If we've not seen the layer before then we will add it
+                    # so that if we see it again we can skip formatting it.
+                    self.seen_layers.append(key_values)
+                    # Note: this *ought* to be len(...) - 1 but let's be safe.
+                    index = self.seen_layers.index(key_values)
+                    try:
+                        pformatted = force_text(pformat(temp_layer))
+                    except UnicodeEncodeError:
+                        pass
+                    else:
+                        # Note: this *ought* to be len(...) - 1 but let's be safe.
+                        self.pformat_layers.insert(index, pformatted)
+                        context_list.append(pformatted)
+
+        kwargs['context'] = context_list
+        kwargs['context_processors'] = getattr(context, 'context_processors', None)
+        self.templates.append(kwargs)
+
+    # Implement the Panel API
+
+    nav_title = _("Templates")
+
+    @property
+    def title(self):
+        num_templates = len(self.templates)
+        return _("Templates (%(num_templates)s rendered)") % {'num_templates': num_templates}
+
+    @property
+    def nav_subtitle(self):
+        if self.templates:
+            return self.templates[0]['template'].name
+        return ''
+
+    template = 'debug_toolbar/panels/templates.html'
+
+    @classmethod
+    def get_urls(cls):
+        return [
+            url(r'^template_source/$', views.template_source, name='template_source'),
+        ]
+
+    def enable_instrumentation(self):
+        template_rendered.connect(self._store_template_info)
+
+    def disable_instrumentation(self):
+        template_rendered.disconnect(self._store_template_info)
+
+    def generate_stats(self, request, response):
+        template_context = []
+        for template_data in self.templates:
+            info = {}
+            # Clean up some info about templates
+            template = template_data.get('template', None)
+            if hasattr(template, 'origin') and template.origin and template.origin.name:
+                template.origin_name = template.origin.name
+                template.origin_hash = signing.dumps(template.origin.name)
+            else:
+                template.origin_name = _('No origin')
+                template.origin_hash = ''
+            info['template'] = template
+            # Clean up context for better readability
+            if self.toolbar.config['SHOW_TEMPLATE_CONTEXT']:
+                context_list = template_data.get('context', [])
+                info['context'] = '\n'.join(context_list)
+            template_context.append(info)
+
+        # Fetch context_processors/template_dirs from any template
+        if self.templates:
+            context_processors = self.templates[0]['context_processors']
+            template = self.templates[0]['template']
+            # django templates have the 'engine' attribute, while jinja templates use 'backend'
+            engine_backend = getattr(template, 'engine', None) or getattr(template, 'backend')
+            template_dirs = engine_backend.dirs
+        else:
+            context_processors = None
+            template_dirs = []
+
+        self.record_stats({
+            'templates': template_context,
+            'template_dirs': [normpath(x) for x in template_dirs],
+            'context_processors': context_processors,
+        })

+ 78 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/templates/views.py

@@ -0,0 +1,78 @@
+from __future__ import absolute_import, unicode_literals
+
+from django.core import signing
+from django.http import HttpResponseBadRequest
+from django.template import TemplateDoesNotExist
+from django.template.engine import Engine
+from django.template.response import SimpleTemplateResponse
+from django.utils.safestring import mark_safe
+
+from debug_toolbar.decorators import require_show_toolbar
+
+try:
+    from django.template import Origin
+except ImportError:
+    Origin = None
+
+
+@require_show_toolbar
+def template_source(request):
+    """
+    Return the source of a template, syntax-highlighted by Pygments if
+    it's available.
+    """
+    template_origin_name = request.GET.get('template_origin', None)
+    if template_origin_name is None:
+        return HttpResponseBadRequest('"template_origin" key is required')
+    try:
+        template_origin_name = signing.loads(template_origin_name)
+    except Exception:
+        return HttpResponseBadRequest('"template_origin" is invalid')
+    template_name = request.GET.get('template', template_origin_name)
+
+    final_loaders = []
+    loaders = Engine.get_default().template_loaders
+
+    for loader in loaders:
+        if loader is not None:
+            # When the loader has loaders associated with it,
+            # append those loaders to the list. This occurs with
+            # django.template.loaders.cached.Loader
+            if hasattr(loader, 'loaders'):
+                final_loaders += loader.loaders
+            else:
+                final_loaders.append(loader)
+
+    for loader in final_loaders:
+        if Origin:  # django>=1.9
+            origin = Origin(template_origin_name)
+            try:
+                source = loader.get_contents(origin)
+                break
+            except TemplateDoesNotExist:
+                pass
+        else:  # django<1.9
+            try:
+                source, _ = loader.load_template_source(template_name)
+                break
+            except TemplateDoesNotExist:
+                pass
+    else:
+        source = "Template Does Not Exist: %s" % (template_origin_name,)
+
+    try:
+        from pygments import highlight
+        from pygments.lexers import HtmlDjangoLexer
+        from pygments.formatters import HtmlFormatter
+
+        source = highlight(source, HtmlDjangoLexer(), HtmlFormatter())
+        source = mark_safe(source)
+        source.pygmentized = True
+    except ImportError:
+        pass
+
+    # Using SimpleTemplateResponse avoids running global context processors.
+    return SimpleTemplateResponse('debug_toolbar/panels/template_source.html', {
+        'source': source,
+        'template_name': template_name
+    })

+ 8 - 5
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/panels/timer.py → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/timer.py

@@ -1,14 +1,17 @@
 from __future__ import absolute_import, unicode_literals
 
-try:
-    import resource     # Not available on Win32 systems
-except ImportError:
-    resource = None
 import time
+
 from django.template.loader import render_to_string
 from django.utils.translation import ugettext_lazy as _
+
 from debug_toolbar.panels import Panel
 
+try:
+    import resource     # Not available on Win32 systems
+except ImportError:
+    resource = None
+
 
 class TimerPanel(Panel):
     """
@@ -52,7 +55,7 @@ class TimerPanel(Panel):
         if self.has_content:
             self._start_rusage = resource.getrusage(resource.RUSAGE_SELF)
 
-    def process_response(self, request, response):
+    def generate_stats(self, request, response):
         stats = {}
         if hasattr(self, '_start_time'):
             stats['total_time'] = (time.time() - self._start_time) * 1000

+ 65 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/panels/versions.py

@@ -0,0 +1,65 @@
+from __future__ import absolute_import, unicode_literals
+
+import sys
+
+import django
+from django.apps import apps
+from django.utils.translation import ugettext_lazy as _
+
+from debug_toolbar.panels import Panel
+
+
+class VersionsPanel(Panel):
+    """
+    Shows versions of Python, Django, and installed apps if possible.
+    """
+    @property
+    def nav_subtitle(self):
+        return 'Django %s' % django.get_version()
+
+    title = _("Versions")
+
+    template = 'debug_toolbar/panels/versions.html'
+
+    def generate_stats(self, request, response):
+        versions = [
+            ('Python', '', '%d.%d.%d' % sys.version_info[:3]),
+            ('Django', '', self.get_app_version(django)),
+        ]
+        versions += list(self.gen_app_versions())
+        self.record_stats({
+            'versions': sorted(versions, key=lambda v: v[0]),
+            'paths': sys.path,
+        })
+
+    def gen_app_versions(self):
+        for app_config in apps.get_app_configs():
+            name = app_config.verbose_name
+            app = app_config.module
+            version = self.get_app_version(app)
+            if version:
+                yield app.__name__, name, version
+
+    def get_app_version(self, app):
+        version = self.get_version_from_app(app)
+        if isinstance(version, (list, tuple)):
+            # We strip dots from the right because we do not want to show
+            # trailing dots if there are empty elements in the list/tuple
+            version = '.'.join(str(o) for o in version).rstrip('.')
+        return version
+
+    def get_version_from_app(self, app):
+        if hasattr(app, 'get_version'):
+            get_version = app.get_version
+            if callable(get_version):
+                try:
+                    return get_version()
+                except TypeError:
+                    pass
+            else:
+                return get_version
+        if hasattr(app, 'VERSION'):
+            return app.VERSION
+        if hasattr(app, '__version__'):
+            return app.__version__
+        return

+ 161 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/settings.py

@@ -0,0 +1,161 @@
+from __future__ import absolute_import, unicode_literals
+
+import warnings
+
+from django.conf import settings
+from django.utils import six
+from django.utils.lru_cache import lru_cache
+
+# Always import this module as follows:
+# from debug_toolbar import settings [as dt_settings]
+
+# Don't import directly CONFIG or PANELs, or you will miss changes performed
+# with override_settings in tests.
+
+
+CONFIG_DEFAULTS = {
+    # Toolbar options
+    'DISABLE_PANELS': {'debug_toolbar.panels.redirects.RedirectsPanel'},
+    'INSERT_BEFORE': '</body>',
+    'JQUERY_URL': '//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js',
+    'RENDER_PANELS': None,
+    'RESULTS_CACHE_SIZE': 10,
+    'ROOT_TAG_EXTRA_ATTRS': '',
+    'SHOW_COLLAPSED': False,
+    'SHOW_TOOLBAR_CALLBACK': 'debug_toolbar.middleware.show_toolbar',
+    # Panel options
+    'EXTRA_SIGNALS': [],
+    'ENABLE_STACKTRACES': True,
+    'HIDE_IN_STACKTRACES': (
+        'socketserver' if six.PY3 else 'SocketServer',
+        'threading',
+        'wsgiref',
+        'debug_toolbar',
+        'django',
+    ),
+    'PROFILER_MAX_DEPTH': 10,
+    'SHOW_TEMPLATE_CONTEXT': True,
+    'SKIP_TEMPLATE_PREFIXES': (
+        'django/forms/widgets/',
+        'admin/widgets/',
+    ),
+    'SQL_WARNING_THRESHOLD': 500,   # milliseconds
+}
+
+
+@lru_cache()
+def get_config():
+    USER_CONFIG = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {})
+
+    # Backward-compatibility for 1.0, remove in 2.0.
+    _RENAMED_CONFIG = {
+        'RESULTS_STORE_SIZE': 'RESULTS_CACHE_SIZE',
+        'ROOT_TAG_ATTRS': 'ROOT_TAG_EXTRA_ATTRS',
+        'HIDDEN_STACKTRACE_MODULES': 'HIDE_IN_STACKTRACES'
+    }
+    for old_name, new_name in _RENAMED_CONFIG.items():
+        if old_name in USER_CONFIG:
+            warnings.warn(
+                "%r was renamed to %r. Update your DEBUG_TOOLBAR_CONFIG "
+                "setting." % (old_name, new_name), DeprecationWarning)
+            USER_CONFIG[new_name] = USER_CONFIG.pop(old_name)
+
+    if 'HIDE_DJANGO_SQL' in USER_CONFIG:
+        warnings.warn(
+            "HIDE_DJANGO_SQL was removed. Update your "
+            "DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning)
+        USER_CONFIG.pop('HIDE_DJANGO_SQL')
+
+    if 'TAG' in USER_CONFIG:
+        warnings.warn(
+            "TAG was replaced by INSERT_BEFORE. Update your "
+            "DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning)
+        USER_CONFIG['INSERT_BEFORE'] = '</%s>' % USER_CONFIG.pop('TAG')
+
+    CONFIG = CONFIG_DEFAULTS.copy()
+    CONFIG.update(USER_CONFIG)
+
+    if 'INTERCEPT_REDIRECTS' in USER_CONFIG:
+        warnings.warn(
+            "INTERCEPT_REDIRECTS is deprecated. Please use the "
+            "DISABLE_PANELS config in the "
+            "DEBUG_TOOLBAR_CONFIG setting.", DeprecationWarning)
+        if USER_CONFIG['INTERCEPT_REDIRECTS']:
+            if 'debug_toolbar.panels.redirects.RedirectsPanel' \
+                    in CONFIG['DISABLE_PANELS']:
+                # RedirectsPanel should be enabled
+                try:
+                    CONFIG['DISABLE_PANELS'].remove(
+                        'debug_toolbar.panels.redirects.RedirectsPanel'
+                    )
+                except KeyError:
+                    # We wanted to remove it, but it didn't exist. This is fine
+                    pass
+        elif 'debug_toolbar.panels.redirects.RedirectsPanel' \
+                not in CONFIG['DISABLE_PANELS']:
+            # RedirectsPanel should be disabled
+            CONFIG['DISABLE_PANELS'].add(
+                'debug_toolbar.panels.redirects.RedirectsPanel'
+            )
+
+    return CONFIG
+
+
+PANELS_DEFAULTS = [
+    'debug_toolbar.panels.versions.VersionsPanel',
+    'debug_toolbar.panels.timer.TimerPanel',
+    'debug_toolbar.panels.settings.SettingsPanel',
+    'debug_toolbar.panels.headers.HeadersPanel',
+    'debug_toolbar.panels.request.RequestPanel',
+    'debug_toolbar.panels.sql.SQLPanel',
+    'debug_toolbar.panels.staticfiles.StaticFilesPanel',
+    'debug_toolbar.panels.templates.TemplatesPanel',
+    'debug_toolbar.panels.cache.CachePanel',
+    'debug_toolbar.panels.signals.SignalsPanel',
+    'debug_toolbar.panels.logging.LoggingPanel',
+    'debug_toolbar.panels.redirects.RedirectsPanel',
+]
+
+
+@lru_cache()
+def get_panels():
+    try:
+        PANELS = list(settings.DEBUG_TOOLBAR_PANELS)
+    except AttributeError:
+        PANELS = PANELS_DEFAULTS
+    else:
+        # Backward-compatibility for 1.0, remove in 2.0.
+        _RENAMED_PANELS = {
+            'debug_toolbar.panels.version.VersionDebugPanel':
+            'debug_toolbar.panels.versions.VersionsPanel',
+            'debug_toolbar.panels.timer.TimerDebugPanel':
+            'debug_toolbar.panels.timer.TimerPanel',
+            'debug_toolbar.panels.settings_vars.SettingsDebugPanel':
+            'debug_toolbar.panels.settings.SettingsPanel',
+            'debug_toolbar.panels.headers.HeaderDebugPanel':
+            'debug_toolbar.panels.headers.HeadersPanel',
+            'debug_toolbar.panels.request_vars.RequestVarsDebugPanel':
+            'debug_toolbar.panels.request.RequestPanel',
+            'debug_toolbar.panels.sql.SQLDebugPanel':
+            'debug_toolbar.panels.sql.SQLPanel',
+            'debug_toolbar.panels.template.TemplateDebugPanel':
+            'debug_toolbar.panels.templates.TemplatesPanel',
+            'debug_toolbar.panels.cache.CacheDebugPanel':
+            'debug_toolbar.panels.cache.CachePanel',
+            'debug_toolbar.panels.signals.SignalDebugPanel':
+            'debug_toolbar.panels.signals.SignalsPanel',
+            'debug_toolbar.panels.logger.LoggingDebugPanel':
+            'debug_toolbar.panels.logging.LoggingPanel',
+            'debug_toolbar.panels.redirects.InterceptRedirectsDebugPanel':
+            'debug_toolbar.panels.redirects.RedirectsPanel',
+            'debug_toolbar.panels.profiling.ProfilingDebugPanel':
+            'debug_toolbar.panels.profiling.ProfilingPanel',
+        }
+        for index, old_panel in enumerate(PANELS):
+            new_panel = _RENAMED_PANELS.get(old_panel)
+            if new_panel is not None:
+                warnings.warn(
+                    "%r was renamed to %r. Update your DEBUG_TOOLBAR_PANELS "
+                    "setting." % (old_panel, new_panel), DeprecationWarning)
+                PANELS[index] = new_panel
+    return PANELS

+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/css/print.css → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/css/print.css


+ 10 - 5
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/css/toolbar.css → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/css/toolbar.css

@@ -38,13 +38,14 @@
 	font-family:sans-serif;
 	text-align:left;
 	text-shadow: none;
+	white-space: normal;
 	-webkit-transition: none;
     -moz-transition: none;
     -o-transition: none;
     transition: none;
 }
 
-#djDebug button {
+#djDebug button, #djDebug a.button {
 	background-color: #eee;
 	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eee), color-stop(100%, #cccccc));
 	background-image: -webkit-linear-gradient(top, #eee, #cccccc);
@@ -64,7 +65,7 @@
 	text-shadow: 0 1px 0 #eee;
 }
 
-#djDebug button:hover {
+#djDebug button:hover, #djDebug a.button:hover {
     background-color: #ddd;
     background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ddd), color-stop(100%, #bbb));
     background-image: -webkit-linear-gradient(top, #ddd, #bbb);
@@ -78,7 +79,7 @@
     text-shadow: 0 1px 0 #ddd;
 }
 
-#djDebug button:active {
+#djDebug button:active, #djDebug a.button:active {
     border: 1px solid #aaa;
     border-bottom: 1px solid #888;
     -webkit-box-shadow: inset 0 0 5px 2px #aaa, 0 1px 0 0 #eee;
@@ -286,7 +287,7 @@
 	border-collapse:collapse;
 	width:100%;
 	background-color:#fff;
-	display:block;
+	display:table;
 	margin-top:0.8em;
 	overflow: auto;
 }
@@ -457,6 +458,7 @@
 }
 
 #djDebug .djDebugSql {
+	word-break:break-word;
 	z-index:100000002;
 }
 
@@ -502,7 +504,7 @@
 #djDebug .highlight .s2 { color:#333 } /* Literal.String.Double */
 #djDebug .highlight .cp { color:#333 } /* Comment.Preproc */
 
-#djDebug .timeline {
+#djDebug .djdt-timeline {
     width: 30%;
 }
 #djDebug .djDebugTimeline {
@@ -656,3 +658,6 @@
 #djDebug .djdt-highlighted {
     background-color: lightgrey;
 }
+.djdt-hidden {
+    display: none;
+}

+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/img/ajax-loader.gif → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/ajax-loader.gif


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/img/back.png → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/back.png


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/img/back_hover.png → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/back_hover.png


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/img/close.png → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/close.png


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/img/close_hover.png → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/close_hover.png


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/img/djdt_vertical.png → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/djdt_vertical.png


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/img/indicator.png → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/img/indicator.png


+ 0 - 0
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/js/jquery_existing.js → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/js/jquery_existing.js


+ 4 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/js/jquery_post.js

@@ -0,0 +1,4 @@
+var djdt = {jQuery: jQuery.noConflict(true)};
+if (window.define) {
+    window.define.amd = _djdt_define_amd_backup;
+}

+ 5 - 0
desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/js/jquery_pre.js

@@ -0,0 +1,5 @@
+var _djdt_define_amd_backup;
+if (window.define) {
+    _djdt_define_amd_backup = window.define.amd;
+    window.define.amd = undefined;
+}

+ 13 - 12
desktop/core/ext-py/django-debug-toolbar-1.3.2/debug_toolbar/static/debug_toolbar/js/toolbar.js → desktop/core/ext-py/django-debug-toolbar-1.9.1/debug_toolbar/static/debug_toolbar/js/toolbar.js

@@ -19,16 +19,15 @@
                 } else {
                     $('.djdt-panelContent').hide(); // Hide any that are already open
                     var inner = current.find('.djDebugPanelContent .djdt-scroll'),
-                        store_id = $('#djDebug').data('store-id'),
-                        render_panel_url = $('#djDebug').data('render-panel-url');
-                    if (store_id !== '' && inner.children().length === 0) {
+                        store_id = $('#djDebug').data('store-id');
+                    if (store_id && inner.children().length === 0) {
                         var ajax_data = {
                             data: {
                                 store_id: store_id,
                                 panel_id: this.className
                             },
                             type: 'GET',
-                            url: render_panel_url
+                            url: $('#djDebug').data('render-panel-url')
                         };
                         $.ajax(ajax_data).done(function(data){
                             inner.prev().remove();  // Remove AJAX loader
@@ -64,16 +63,16 @@
 
                 if (name == 'button') {
                     var form = self.parents('form:eq(0)');
-                    ajax_data['url'] = self.attr('formaction');
+                    ajax_data.url = self.attr('formaction');
 
                     if (form.length) {
-                        ajax_data['data'] = form.serialize();
-                        ajax_data['type'] = form.attr('method') || 'POST';
+                        ajax_data.data = form.serialize();
+                        ajax_data.type = form.attr('method') || 'POST';
                     }
                 }
 
                 if (name == 'a') {
-                    ajax_data['url'] = self.attr('href');
+                    ajax_data.url = self.attr('href');
                 }
 
                 $.ajax(ajax_data).done(function(data){
@@ -141,13 +140,13 @@
                     // due to djdt.handleDragged being set to true.
                     if (djdt.handleDragged || event.pageY != startPageY) {
                         var top = baseY + event.clientY;
-                        
+
                         if (top < 0) {
                             top = 0;
                         } else if (top + handle.height() > windowHeight) {
                             top = windowHeight - handle.height();
                         }
-                        
+
                         handle.css({top: top});
                         djdt.handleDragged = true;
                     }
@@ -213,11 +212,13 @@
             $('#djDebugToolbar li').removeClass('djdt-active');
             // finally close toolbar
             $('#djDebugToolbar').hide('fast');
-            $('#djDebugToolbarHandle').show();
+            handle = $('#djDebugToolbarHandle');
+            handle.show();
             // set handle position
             var handleTop = djdt.cookie.get('djdttop');
             if (handleTop) {
-                $('#djDebugToolbarHandle').css({top: handleTop + 'px'});
+                handleTop = Math.min(handleTop, window.innerHeight - handle.outerHeight() - 10);
+                handle.css({top: handleTop + 'px'});
             }
             // Unbind keydown
             $(document).unbind('keydown.djDebug');

Vissa filer visades inte eftersom för många filer har ändrats