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
If SQLite is unable to open the database file, this means that the SQLite database you are trying to open is corrupted. There are various causes of corruption, such as file overwrite issues, file locking issues, database synchronization failures, storage media failures, and many more.
It is not impossible to use Django with Sqlite as database in production, primarily depending on your website/webapp traffic and how hard you hit your db (alongside what kind of operations you perform on it i.e. reads/writes/etc).
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With