diff --git a/minerva_analysis/__init__.py b/minerva_analysis/__init__.py index a9f1dbf98..74440e590 100644 --- a/minerva_analysis/__init__.py +++ b/minerva_analysis/__init__.py @@ -11,12 +11,6 @@ import sys import multiprocessing -app = Flask(__name__, template_folder=Path('client/templates'), static_folder='data') -app.config['TEMPLATES_AUTO_RELOAD'] = True -app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///server/db.sqlite3' -app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False -app.config['CLIENT_PATH'] = app.root_path + '/client/' - # If you're running the pyinstaller version of the code, create a # new directory for the data (this will be at ~/ on mac) if getattr(sys, 'frozen', False): @@ -25,6 +19,12 @@ else: data_path = Path("minerva_analysis/data") +app = Flask(__name__, template_folder=Path('client/templates'), static_folder='data') +app.config['TEMPLATES_AUTO_RELOAD'] = True +app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + str(data_path.resolve()) + '/db.sqlite3' +app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False +app.config['CLIENT_PATH'] = app.root_path + '/client/' + config_json_path = data_path / "config.json" db = SQLAlchemy(app)