diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-07-22 23:17:48 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-07-22 23:17:48 +0200 |
commit | 41a0b83f342221c3dd5bf4ac6678f1822a936343 (patch) | |
tree | 9900a7dba07d05e982c665dff2ab3ee7adb67314 | |
parent | 9ea03dcadcfcfca2435663494ec53493196b6244 (diff) | |
download | kosten-41a0b83f342221c3dd5bf4ac6678f1822a936343.tar.gz kosten-41a0b83f342221c3dd5bf4ac6678f1822a936343.tar.bz2 kosten-41a0b83f342221c3dd5bf4ac6678f1822a936343.zip |
Settings splitting
-rw-r--r-- | app/__init__.py | 5 | ||||
-rw-r--r-- | 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) |