In the SQLAlchemy panel, detect if Flask-SQLAlchemy is not set up to record
queries for the current app, and display the necessary steps to set it up.
The following steps will be detected and displayed if needed:
* install Flask-SQLAlchemy package
* add the extension to this app
* set SQLALCHEMY_RECORD_QUERIES if DEBUG is False
The code for displaying the SQL select results and explain plan were nearly
identical, so this consolidates it to one function and template. It also fixes
correctly displaying the timing results as milliseconds.
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
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.
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.
simplejson is only needed for the SQLAlchemy panel on Python < 2.6
Also, provides a nice error message in the SQLAlchemy panel about
missing dependencies.
Initialize the logging panel log handler on the first request so that
werkzeug sets up its default logger first. Werkzeug now only adds its
default log handler if no others are set up yet. So, when the logging
panel set up its logger first, it suppressed the output from the
development server.
- Rename the package to flask_debugtoolbar
- Fix importing of the panels so that the views in the panels are correctly registered in the blueprint
There is still one major problem in the sqlalchemy panel where we are not able to get the SQLAlchemy reference