#!/usr/bin/env python # -*- coding: utf-8 -*- import time from django.dispatch import dispatcher from django.core.signals import request_started from django.test.signals import template_rendered from django.conf import settings from django.db import connection from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe # Frame inspection code credit goes to django-logging (http://code.google.com/p/django-logging/) FRAME_INSPECT = True if FRAME_INSPECT: import inspect import django from django.contrib import admin _django_path = django.__file__.split('__init__')[0] _admin_path = admin.__file__.split('__init__')[0] USE_PYGMENTS = False try: import textwrap from pygments import highlight from pygments.formatters import HtmlFormatter from pygments.lexers import SqlLexer from pygments.lexers import PythonLexer from pygments.styles import get_style_by_name USE_PYGMENTS = True except ImportError: pass if USE_PYGMENTS: WRAP = 120 SQL_STYLE = get_style_by_name('colorful') PYTHON_STYLE = get_style_by_name('friendly') HEIGHT = '240px' # or '100%' if full height is wished TEMPLATE = """