From ecfc0bae97919a88b22145415cb54e3cc170eec2 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 24 Apr 2018 16:11:43 -0700 Subject: wire up debug toolbar (cool!) --- config.py | 5 +++++ fatcat/__init__.py | 3 +++ run.py | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index bad871dc..a7ec4b50 100644 --- a/config.py +++ b/config.py @@ -6,3 +6,8 @@ class Config(object): SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URI') or \ 'sqlite:///' + os.path.join(basedir, 'fatcat_dev.sqlite') SQLALCHEMY_TRACK_MODIFICATIONS = False + + # "Event more verbose" debug options. SECRET_KEY is bogus. + #SQLALCHEMY_ECHO = True + #SECRET_KEY = "kuhy0284hflskjhg01284" + #DEBUG = True diff --git a/fatcat/__init__.py b/fatcat/__init__.py index 74e25f1e..a824d220 100644 --- a/fatcat/__init__.py +++ b/fatcat/__init__.py @@ -2,11 +2,14 @@ from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow +from flask_debugtoolbar import DebugToolbarExtension from config import Config +toolbar = DebugToolbarExtension() app = Flask(__name__) app.config.from_object(Config) db = SQLAlchemy(app) ma = Marshmallow(app) +toolbar = DebugToolbarExtension(app) from fatcat import routes, models, api, sql, dummy diff --git a/run.py b/run.py index 512d5828..0fbd6194 100755 --- a/run.py +++ b/run.py @@ -8,7 +8,7 @@ def main(): parser = argparse.ArgumentParser() parser.add_argument('--debug', action='store_true', - help="enable debugging interface") + help="enable debugging interface (note: not for everything)") parser.add_argument('--host', default="127.0.0.1", help="listen on this host/IP") -- cgit v1.2.3