diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90f4cd8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +quotes.db diff --git a/backend/quote.py b/backend/quote.py index f80abeb..c6e5274 100644 --- a/backend/quote.py +++ b/backend/quote.py @@ -1,3 +1,5 @@ +import os + import marshmallow import sqlalchemy import sqlalchemy.orm @@ -6,7 +8,9 @@ import sqlalchemy.ext.declarative from datetime import datetime -engine = sqlalchemy.create_engine('sqlite:////tmp/quotes.db') # FIXME +DB_PATH = os.path.expandvars('$HOME/quotes/quotes.db') + +engine = sqlalchemy.create_engine(f'sqlite:///{DB_PATH}') Session = sqlalchemy.orm.sessionmaker(bind=engine) Base = sqlalchemy.ext.declarative.declarative_base()