Flask Debug Toolbar
Flask Debug Toolbar is a Flask extension that aids development by adding debugging tools into the web view of your application. It gives you information such as the bottlenecks in your view rendering code, and how many SQLAlchemy queries it took to render the view.
As always, we will use pip
to install Flask Debug Toolbar:
$ pip install flask-debugtoolbar
Next, we need to add Flask Debug Toolbar to the extensions.py
file. As we will be modifying this file a lot in this chapter, here is the start of the file so far along with the code to initialize Flask Debug Toolbar:
from flask import flash, redirect, url_for, session from flask.ext.bcrypt import Bcrypt from flask.ext.openid import OpenID from flask_oauth import OAuth from flask.ext.login import LoginManager from flask.ext.principal import Principal, Permission, RoleNeed from flask.ext.restful import Api from flask.ext.celery import Celery from flask.ext.debugtoolbar import DebugToolbarExtension bcrypt = Bcrypt() oid...