From 0690d180d4222a31777fa218fe7f22a8ecec45ea Mon Sep 17 00:00:00 2001 From: Julian Rother <julianr@fsmpi.rwth-aachen.de> Date: Thu, 8 Sep 2016 14:18:12 +0200 Subject: [PATCH] Use config.py.example as default config --- config.py.example | 12 +++++++++--- run.py | 2 ++ server.py | 15 ++++----------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/config.py.example b/config.py.example index 7c9da57..eb145f3 100644 --- a/config.py.example +++ b/config.py.example @@ -1,13 +1,19 @@ -# Config for testing purposes only, don't run this in production! +# Defaults for development ,do not use in production! DEBUG = True +VIDEOPREFIX = 'https://videoag.fsmpi.rwth-aachen.de' +DB_SCHEMA = 'db_schema.sql' +DB_DATA = 'db_example.sql' + +#DB_ENGINE = 'mysql' #MYSQL_HOST = 'localhost' #MYSQL_USER = 'videoag' #MYSQL_PASSWD = 'somuchsecret' #MYSQL_DB = 'videos' -#DB_ENGINE = 'mysql' -SQLITE_DB = 'db.sqlite' DB_ENGINE = 'sqlite' +SQLITE_DB = 'db.sqlite' SQLITE_INIT_SCHEMA = True SQLITE_INIT_DATA = True + +#LDAP_HOST = 'ldaps://rumo.fsmpi.rwth-aachen.de' diff --git a/run.py b/run.py index 2c83cd4..5c45725 100755 --- a/run.py +++ b/run.py @@ -1,5 +1,7 @@ #!/usr/bin/env python from server import * +global is_debug +is_debug = True if __name__ == '__main__': app.run(threaded=True) diff --git a/server.py b/server.py index 9384ad7..ecd2cda 100755 --- a/server.py +++ b/server.py @@ -23,17 +23,10 @@ timer.daemon = True timer.start() config = app.config -config['DB_SCHEMA'] = 'db_schema.sql' -config['DB_DATA'] = 'db_example.sql' -config['DB_ENGINE'] = 'sqlite' -config['SQLITE_DB'] = 'db.sqlite' -config['SQLITE_INIT_SCHEMA'] = True -config['SQLITE_INIT_DATA'] = False -config['DEBUG'] = False -config['VIDEOPREFIX'] = 'https://videoag.fsmpi.rwth-aachen.de' -if __name__ == '__main__': - config['SQLITE_INIT_DATA'] = True - config['DEBUG'] = True +config.from_pyfile('config.py.example', silent=True) +if 'is_debug' in globals(): + config['SQLITE_INIT_DATA'] = False + config['DEBUG'] = False config.from_pyfile('config.py', silent=True) if config['DEBUG']: app.jinja_env.auto_reload = True -- GitLab