I have been moving my flask apps from replit to my server, and things have been going smoothly, but I am moving my first app with SQL in it over to the server, and there keeps being errors when I open the database in the code. In the Apache error log, it says:
sqlite3.OperationalError: unable to open database file
The app works well on replit, the database is in the same folder, but it doesn't work. Does anybody know why? I am using Ubuntu Server 20.04
I have figured out why it's not working! The database was in the same dir as init.py, but wsgi calls it as a module in a different dir, so it wasn't calling the db. Adding an absolute path eg. /var/www/theapp/theapp/database.db works.
Flask not opening SQLite Database on apache2