Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databases folder missing for the example app todo #1

Open
andreaschizzali opened this issue Jul 11, 2024 · 1 comment
Open

databases folder missing for the example app todo #1

andreaschizzali opened this issue Jul 11, 2024 · 1 comment

Comments

@andreaschizzali
Copy link

By running the py4web-example-apps I get the following error message for the todo app:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\github\\py4web-example-apps\\apps\\todo\\databases\\sql.log'
The app todo is minimalistic, there is only init.py with
```
db = DAL(
"sqlite://storage.db", folder=os.path.join(os.path.dirname(file), "databases")
)
db.define_table("todo", Field("info"))
db.commit()


In a new Installation the folder "databases" ist not present. Perheaps the issue can be solved so:

from py4web.core import required_folder
db = DAL(
"sqlite://storage.db", folder=required_folder(os.path.dirname(file), "databases")
)
db.define_table("todo", Field("info"))
db.commit()

@mdipierro
Copy link
Contributor

mdipierro commented Jul 11, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants