Django error opening SQLite3 db file on when runni

2019-04-08 07:33发布

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

1条回答
再贱就再见
2楼-- · 2019-04-08 08:25

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
查看更多
登录 后发表回答