Emir Sürmen
Emir Sürmen

Reputation: 950

Apache2 WSGI Flask app gives sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file

I get this error when I try to enter my Flask app running on WSGI and Apaceh2: enter image description here

The problem is, when I just run the Flask app and stop apache2, the error doesn't occur. But when I open Apache2, the error occurs. The file is located at /var/www/html/meondashboard/configs. This is how my 000-default.conf file look like: enter image description here

This is how I access the file: enter image description here

How can I fix this? Do I need to restart my VPS? I would appreciate any type of help, thanks in advance.

Upvotes: 2

Views: 525

Answers (1)

heydar dasoomi
heydar dasoomi

Reputation: 557

Give app.config['SQLALCHEMY_DATABASE_URI'] full path. Then give .db file ownership to www-data.

Upvotes: 4

Related Questions