Django在关闭Apache时打开SQLite3 db文件时出错 [英] Django error opening SQLite3 db file on when running off Apache
本文介绍了Django在关闭Apache时打开SQLite3 db文件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到此错误:
/
无法打开数据库文件
到目前为止,我尝试过的事情是在settings.py中设置dev.db文件的绝对路径.我尝试将www-data添加到我的管理组中,并将项目文件夹的组设置为admin,并将该组设置为www-data,但没有一个解决了问题.
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!
肖恩
推荐答案
刚刚过去了30分钟,这个问题让我大吃一惊..
Just passed the last 30 minutes banging my head on this problem ..
解决方案
在您的settings.py中:
In your settings.py:
DATABASE_NAME = '/absolute/path/to/your/database.db'
设置权限:
chown www-data /absolute/path/to/your/
chown www-data /absolute/path/to/your/database.db
这篇关于Django在关闭Apache时打开SQLite3 db文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文