'Ubuntu + Django + SQLite - attempt to write a readonly database

I'm hosting my Django project with Apache on a Ubuntu 20.04 server with the standard SQLite database. It works but the database seems to be read-only.

When we write to the database we get an OperationalError:

attempt to write a readonly database

I have tried to change the permissions according to the guide below

https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-16-04

I've changed the permissions of the sqlite file to 664 and gave user www-data ownership of the file and the parent folder.

Yet I'm still getting the same error. Any ideas what else could be causing this problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source