Forums

Exception Value: no such table: with direct SQL

Hello, I buit an application with the Strava APIs. I have a SQLite database Access to the Django live database works well, but sometimes I do direct SQL code with select .... , and it doesn't find the tables, I think it's a configuration problem. ( Tables pre fixed with app n ame or not ) Has anyone encountered this problem before?

"Exception Value: no such table: myapp_col" my App : xoka06.eu.pythonanywhere.com

The most common cause of that kind of problem with SQLite is if you are using a relative path to specify which database you want to use -- for example, "my.db" rather than "/home/xoka06/something/my.db". If you don't specify the directory, Python will look for the database in whatever its working directory happens to be, which might not be what you expect it to be. So it will open up an empty database (which is what it does by default if it can't find one at the specified location) and you'll get errors like that.

Try specifying the full path to the database and see if that helps.

Thank you, It works very well. My connection to Strava Api too.

Great, glad we could help!

Now I have to pass my App in mySql or MariaDB .... after I can share it

Sorry, I don't understand -- are you asking about how to set up MySQL?