#!/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 USE_PYGMENTS = False try: import textwrap from pygments import highlight from pygments.formatters import HtmlFormatter from pygments.lexers import SqlLexer from pygments.styles import get_style_by_name USE_PYGMENTS = True except ImportError: pass if USE_PYGMENTS: WRAP = 120 STYLE = get_style_by_name('colorful') HEIGHT = '240px' # or '100%' if full height is wished TEMPLATE = """