Django 管理员不喜欢 SQL 插入
我一直在尝试让 Django 在 Mac 服务器上由 mod_wsgi 提供服务。我知道 Django 可以连接到数据库(因为我可以将权限从只读切换为读/写并查看错误消息更改),但我收到错误无法连接到数据库。我在服务器上使用 SQLite v 3.6.12。导致错误的 SQL 将在显示的错误页面中报告。异常位置是执行中的/Library/Python/2.6/site-packages/django/db/backends/sqlite3/base.py,第234
行回溯中最后一次调用中显示的错误是
cursor <django.db.backends.util.CursorDebugWrapper object at 0x102c16a50>
self <django.db.models.sql.compiler.SQLInsertCompiler object at 0x102c16910>
params ('d59df55372475754aa91299d0c5662b6','NmNlOThlYTVjYTIwYWZjZDgwMzFiMTMxZThjZmRhYzg3NDQ3MzcwYzqAAn1xAVUKdGVzdGNvb2tp\nZXECVQZ3b3JrZWRxA3Mu\n',u'2011-08-02 18:25:48.426508')
result_type None
sql 'INSERT INTO "django_session" ("session_key", "session_data", "expire_date") VALUES (%s, %s, %s)'
错误OperationalError('无法打开数据库文件',)
我该如何调试这个?
I've been trying to get Django to work being served by mod_wsgi on a Mac Server. I know Django can connect to the database (because I can toggle permissions from readonly to read/write and see the error message change) but I get an error cannot connect to database. I'm using SQLite v 3.6.12 on the server. The SQL that causes the error is reported in the Error page that shows up. The exception location is /Library/Python/2.6/site-packages/django/db/backends/sqlite3/base.py in execute, line 234
The error that shows up in the last calls in the traceback is
cursor <django.db.backends.util.CursorDebugWrapper object at 0x102c16a50>
self <django.db.models.sql.compiler.SQLInsertCompiler object at 0x102c16910>
params ('d59df55372475754aa91299d0c5662b6','NmNlOThlYTVjYTIwYWZjZDgwMzFiMTMxZThjZmRhYzg3NDQ3MzcwYzqAAn1xAVUKdGVzdGNvb2tp\nZXECVQZ3b3JrZWRxA3Mu\n',u'2011-08-02 18:25:48.426508')
result_type None
sql 'INSERT INTO "django_session" ("session_key", "session_data", "expire_date") VALUES (%s, %s, %s)'
with the error OperationalError('unable to open database file',)
How do I go about debugging this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 SQLite 数据库,数据库文件及其包含的目录对于尝试使用它的用户必须是可写的。
For SQLite databases, both the database file and the directory it is contained in must be writable to user trying to use it.