Python – Django error opening SQLite3 db file on when running off Apache

djangopythonsqliteUbuntu

I got this error:

OperationalError at /

unable to open database file

Things I've tried so far are setting the absolute path of my dev.db file in the settings.py. I've tried adding www-data to my admin group and setting the group of my project folder to the admin, and setting the group to www-data, none of which solved the problem.

I'm completely stuck here, if anyone has a solution it would be MUCH appreciated!

Shawn

Best Answer

Just passed the last 30 minutes banging my head on this problem ..

Solution

In your settings.py:

DATABASE_NAME = '/absolute/path/to/your/database.db'

Setting rights:

chown www-data /absolute/path/to/your/
chown www-data /absolute/path/to/your/database.db