From f511c54f8591def6e9458a8e51ee84e64f437059 Mon Sep 17 00:00:00 2001 From: Andreas Chizzali Date: Thu, 11 Jul 2024 09:28:03 +0200 Subject: [PATCH] Update __init__.py - databases folder required im,ported and used required_folder() to create the folder for a new installation --- apps/todo/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/todo/__init__.py b/apps/todo/__init__.py index 4766d53..44a107e 100644 --- a/apps/todo/__init__.py +++ b/apps/todo/__init__.py @@ -6,8 +6,9 @@ cache = Cache(size=1000) # define database and tables +from py4web.core import required_folder db = DAL( - "sqlite://storage.db", folder=os.path.join(os.path.dirname(__file__), "databases") + "sqlite://storage.db", folder=required_folder(os.path.dirname(__file__), "databases") ) db.define_table("todo", Field("info")) db.commit()