Attempt to write a readonly database - Django w/ SELinux error

后端 未结 8 1860
粉色の甜心
粉色の甜心 2020-12-07 18:32

I have a CentOS server on which I have Apache, Django, Django CMS and mod_wsgi. My Django project files are stored in the /srv directory and I have SELinux tur

8条回答
  •  天命终不由人
    2020-12-07 19:03

    You have to add writing rights to the directory in which your sqlite database is stored. So running chmod 664 /srv/mysite should help.

    This is a security risk, so better solution is to change the owner of your database to www-data:

    chown www-data:www-data /srv/mysite
    chown www-data:www-data /srv/mysite/DATABASE.sqlite
    

提交回复
热议问题