From 41a0b83f342221c3dd5bf4ac6678f1822a936343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Wed, 22 Jul 2020 23:17:48 +0200 Subject: Settings splitting --- app/__init__.py | 5 +++-- settings.py | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 0a02ed4..7c6408a 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,7 +1,7 @@ from flask import Flask # create app -app = Flask('kosten') +app = Flask('kosten', instance_relative_config = True) # force autoescape in all files app.jinja_env.autoescape = True @@ -10,7 +10,8 @@ app.jinja_env.lstrip_blocks = True app.jinja_env.trim_blocks = True # load config -app.config.from_pyfile('settings.py') +app.config.from_object('settings') +app.config.from_pyfile('settings.py', silent = True) from .model import db from .login import login_manager diff --git a/settings.py b/settings.py index d257d0e..76deacb 100644 --- a/settings.py +++ b/settings.py @@ -1,8 +1,5 @@ import os -# set this to False on productive systems -DEBUG = True - # just generate a new secret key on each startup SECRET_KEY = os.urandom(42) -- cgit v1.2.3