Skip to content

Commit

Permalink
moved sqlite db to data folder
Browse files Browse the repository at this point in the history
  • Loading branch information
nchuynh committed Aug 16, 2021
1 parent fff3051 commit 18948b6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions minerva_analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)

Expand Down

0 comments on commit 18948b6

Please sign in to comment.