This question seems to have been asked many times but all the solutions I have checked haven't yet worked for me. I am running nginx
on a Ubuntu 14.04 server with Django 1.6.1 installed. I am attempting to use the default django admin backend for a project (usually at localhost/admin/).
The issue I run into is OperationalError at /admin/ attempt to write a readonly database
(Update when I changed chmod permissions for the db.sqlite3 file the error now reads OperationalError at /admin/ unable to open database file
but I have checked every option on the Django Newbie Mistakes website for the answer and no dice)
Some answers talked about the r+w+x permissions for the generated database file db.sqlite3
as far as I can tell even 777
on the db file doesn't do anything so I've kept it at 656
.
As far as I can tell the django project works find (all pages render fine, the /admin page renders without css. When i attempt to login using localhost/admin/ and click submit I get the django debug page with the error). They are all owned by root:root
. I have tried changing permissions for every file and directory to be owned by www-data:www-data
but nothing.
I have even tried changing the settings.py to have an absolute path to the db instead of os.path.join(BASE_DIR, 'db.sqlite3')
I think its down to an ownership problem but I'll take any help.