The SQL queries were displayed with the `safe` filter which allowed properly
including the Pygments-highlighted HTML, but if Pygments wasn't installed this
allowed the raw SQL to be included without escaping. This change removes the
`safe` filter and instead wraps the Pygments HTML with the `Markup` class. This
allows proper auto-escaping in the template.
Fixes#70
The init_app() restructuring in 356e6c removed "load_panels()", but need
to add it back so panels like SQLAlchemy can register their URLs on the
Blueprint before it's activated.
The template loader wouldn't handle non-ASCII template encodings.
Updated it to use the encoding parameter of the Jinja loader when
reading and writing the template files.
Fixes#46
Werkzeug will disable its default logging setup if another log handler
is already configured. At some point the initialization order changed
and the logging panel's handler is getting added first now, so
werkzeug's request log will not be printed to the console by default. By
explicitly calling werkzeug's logger we now make sure it's initialized
before the logging panel's handler.
Fixes#33
The "printable" filter can throw an exception when trying to display a
user object whose __repr__ implementation returns unicode, which repr()
does not allow. Catch it and display a more informative message
instead.
See #31 and #39
Fixing #31 where the query signing would break when the SECRET_KEY
contained non-ascii values. In the process switch to itsdangerous
instead of rolling our own signatures.
Profiler: Use update_wrapper on partial
If the profiler panel is applied before the request-vars panel, the wrapper added by the profiler causes an error since it's missing a `__module__` attribute.
The `update_wrapper` call is needed so that the new partial
func inherits the `__module__` of the original function.
The `__module__` is needed because the request-vars panel uses
`func.__module__` in building the qualified name.