diff options
Diffstat (limited to 'backend/zmusic/__init__.py')
-rw-r--r-- | backend/zmusic/__init__.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/zmusic/__init__.py b/backend/zmusic/__init__.py index 0855b62..c63f012 100644 --- a/backend/zmusic/__init__.py +++ b/backend/zmusic/__init__.py @@ -8,7 +8,14 @@ import sys import pkgutil app = Flask(__name__) -app.config.from_pyfile(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../app.cfg')) + +base_dir = os.path.dirname(os.path.abspath(__file__)) +if os.path.exists(os.path.join(base_dir, 'app.cfg')): + app.config.from_pyfile(os.path.join(base_dir, 'app.cfg')) +elif os.path.exists(os.path.join(base_dir, '../app.cfg')): + app.config.from_pyfile(os.path.join(base_dir, '../app.cfg')) +else: + raise IOError("Could not find app.cfg.") db = SQLAlchemy(app) |