diff --git a/app/__init__.py b/app/__init__.py index 23739ce..8866c97 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,5 +1,5 @@ -import os import sys +import os from flask import Flask from flask_login import LoginManager @@ -35,8 +35,8 @@ def load_user(user_id): try: from pdc_config import Config, ProdConfig, DevConfig, TestConfig except ImportError: - print("Please set a pdc_config.py file in you PYTHON_PATH") - print("See INSTALL.md for more info") + sys.stderr.write("ERROR: Please set a pdc_config.py file in you PYTHON_PATH\n") + sys.stderr.write("ERROR: See INSTALL.md for more info\n") sys.exit(-1) diff --git a/resources/pdc_config.py b/resources/pdc_config.py index 4edb6be..d73e0d2 100644 --- a/resources/pdc_config.py +++ b/resources/pdc_config.py @@ -1,5 +1,11 @@ +import sys import os -from db_config import * +try: + from db_config import * +except ImportError: + sys.stderr.write("ERROR: Please set a db_config.py file in you PYTHON_PATH\n") + sys.stderr.write("ERROR: See INSTALL.md for more info\n") + sys.exit(-1) root_dir = os.path.abspath(os.path.dirname(__file__)) -- libgit2 0.21.2