From ffcc8843a4c1ca13ffadd0c7759ba4e4dcc68455 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Fri, 27 Nov 2015 12:21:13 +0100 Subject: [PATCH] Change config loading. --- accountant/__init__.py | 9 ++------- accountant/{config.py.dist => config.cfg.dist} | 0 2 files changed, 2 insertions(+), 7 deletions(-) rename accountant/{config.py.dist => config.cfg.dist} (100%) diff --git a/accountant/__init__.py b/accountant/__init__.py index 7939c3d..655b659 100644 --- a/accountant/__init__.py +++ b/accountant/__init__.py @@ -21,18 +21,13 @@ from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.bower import Bower from flask.ext.assets import Environment, Bundle -from . import config - # The app app = Flask(__name__, static_folder=None) -app.config['SQLALCHEMY_DATABASE_URI'] = config.db_uri app.config['SQLALCHEMY_ECHO'] = app.debug -app.config['WTF_CSRF_ENABLED'] = False -app.config['SECRET_KEY'] = 'my_secret_key' +app.config.from_pyfile('config.cfg') -app.debug = config.debug db = SQLAlchemy(app) @@ -46,7 +41,7 @@ app.register_blueprint(api, url_prefix='/api') app.config['BOWER_COMPONENTS_ROOT'] = "../bower_components" -app.config['BOWER_TRY_MINIFIED'] = not config.debug +app.config['BOWER_TRY_MINIFIED'] = not app.debug bower = Bower(app) diff --git a/accountant/config.py.dist b/accountant/config.cfg.dist similarity index 100% rename from accountant/config.py.dist rename to accountant/config.cfg.dist