From 338ef8b280a07cbf9d58779f5374d11e04cce229 Mon Sep 17 00:00:00 2001 From: Steven Loria Date: Sat, 19 Apr 2014 15:36:48 -0400 Subject: [PATCH] Correctly initialize debug toolbar --- {{cookiecutter.app_name}}/requirements/dev.txt | 2 +- .../{{cookiecutter.app_name}}/app.py | 10 +++++----- .../{{cookiecutter.app_name}}/extensions.py | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.app_name}}/requirements/dev.txt b/{{cookiecutter.app_name}}/requirements/dev.txt index 1783bbb..ccb0643 100644 --- a/{{cookiecutter.app_name}}/requirements/dev.txt +++ b/{{cookiecutter.app_name}}/requirements/dev.txt @@ -9,4 +9,4 @@ factory-boy>=2.2.1 Flask-Script # Debug toolbar -Flask-DebugToolbar +Flask-DebugToolbar==0.9.0 diff --git a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/app.py b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/app.py index cff05f6..66209c1 100644 --- a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/app.py +++ b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/app.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- '''The app module, containing the app factory function.''' from flask import Flask, render_template -from flask_debugtoolbar import DebugToolbarExtension from {{cookiecutter.app_name}}.settings import ProdConfig from {{cookiecutter.app_name}}.assets import assets @@ -11,6 +10,7 @@ from {{cookiecutter.app_name}}.extensions import ( db, login_manager, migrate, + debug_toolbar, ) from {{cookiecutter.app_name}} import public, user @@ -30,13 +30,13 @@ def create_app(config_object=ProdConfig): def register_extensions(app): - db.init_app(app) - login_manager.init_app(app) assets.init_app(app) - toolbar = DebugToolbarExtension(app) + bcrypt.init_app(app) cache.init_app(app) + db.init_app(app) + login_manager.init_app(app) + debug_toolbar.init_app(app) migrate.init_app(app, db) - bcrypt.init_app(app) return None diff --git a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/extensions.py b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/extensions.py index a9dc6b7..eff4adb 100644 --- a/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/extensions.py +++ b/{{cookiecutter.app_name}}/{{cookiecutter.app_name}}/extensions.py @@ -17,3 +17,6 @@ migrate = Migrate() from flask.ext.cache import Cache cache = Cache() + +from flask.ext.debugtoolbar import DebugToolbarExtension +debug_toolbar = DebugToolbarExtension()