aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/default_settings.py
diff options
context:
space:
mode:
author0livd <github@destras.fr>2017-08-06 04:06:21 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2017-08-06 04:06:21 +0200
commitc7815e48781b6d3a457eaff1808d179402558f8c (patch)
tree8143ed72a4b4ba974d8da6e7bd3ca7abb33bfbef /ihatemoney/default_settings.py
parent8fd53f827e6678485214d1073a1256737ebf8ce5 (diff)
downloadihatemoney-mirror-c7815e48781b6d3a457eaff1808d179402558f8c.zip
ihatemoney-mirror-c7815e48781b6d3a457eaff1808d179402558f8c.tar.gz
ihatemoney-mirror-c7815e48781b6d3a457eaff1808d179402558f8c.tar.bz2
Fix #248: Database creation issue (#254)
In flask's development server, the route handlers run in a different thread than the main thread thus an in-memory database created in the main thread cannot be acccessed by the route handlers. Switching the default database location to a temporary file solves the isssue. See full explanation here: https://gehrcke.de/2015/05/in-memory-sqlite-database-and-flask-a-threading-trap/
Diffstat (limited to 'ihatemoney/default_settings.py')
-rw-r--r--ihatemoney/default_settings.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ihatemoney/default_settings.py b/ihatemoney/default_settings.py
index 4ca11ca..fcb41db 100644
--- a/ihatemoney/default_settings.py
+++ b/ihatemoney/default_settings.py
@@ -8,7 +8,7 @@ DEBUG = False
# The database URI, reprensenting the type of database and how to connect to it.
# Enter an absolute path here.
-SQLALCHEMY_DATABASE_URI = 'sqlite://'
+SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/ihatemoney.db'
SQLACHEMY_ECHO = DEBUG
# Will likely become the default value in flask-sqlalchemy >=3 ; could be removed