Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django/Apache error "attempt to write a readonly database" [closed]

I am lost, i have tried everything about this issue and can't find solution. I have the app on django 1.8 / python 3.3.5 / centos 7 / apache. It is default sqlite db here. Everytihng is working fine with django's webserver but fails with error "attempt to write a readonly database" on Apache. I have done all checks according to this doc https://code.djangoproject.com/wiki/NewbieMistakes#DjangosaysUnabletoOpenDatabaseFilewhenusingSQLite3 db file and it's root folder have write permissions and "apache apache" user owner but it is still the same error:

OperationalError at /logout/
attempt to write a readonly database
Request Method: GET
Request URL:    http://app.server.corp/logout/
Django Version: 1.8
Exception Type: OperationalError
Exception Value:    
attempt to write a readonly database
Exception Location: /usr/local/lib/python3.3/site-            packages/django/db/backends/sqlite3/base.py in execute, line 318
Python Executable:  /usr/local/bin/python3.3/
like image 594
Mikhail Urbanovich Avatar asked Mar 13 '23 22:03

Mikhail Urbanovich


1 Answers

Its because there was “attempt to write a readonly database” so for me helped following in shell:

chmod 755 db.sqlite3

So we are just changing a permissions to DB file. In other words Server cannot write to file.

like image 63
Dmitry Yudin Avatar answered Apr 08 '23 16:04

Dmitry Yudin