Forums

Not able to access my static database

I'm working on a summer bucket list program that multiple users can add to and I can't seem to access my database that I have stored in my static directory. I have .py file that creates the database and the database both in my static folder. This is how I am connecting it to the rest of my views in my bottle_app.py.

import sqlite3
#set up db connection
activityDB = sqlite3.connect("rbknight1000/mysite/static/summerList.db")
activityC = activityDB.cursor()

I am getting the following error code: Error running WSGI application, sqlite3.OperationalError: unable to open database file.

I have double checked that I have the database named correctly, so I am not sure what the issue is. This is my first time working with SQlite and I am relatively new at all this, so it may be a simple fix. Let me know if you need to see anything else to get an idea of the problem.

Try with the full path to the db file

/home/rbknight1000/mysite/static/summerList.db

also, you may want to look into https://help.pythonanywhere.com/pages/NoSuchFileOrDirectory