attempt to write a readonly database [Django 3.2.15 LTS]

Hi, my use ubuntu 22.04 from apache 2.

My error
OperationalError at /accounts/login/
attempt to write a readonly database

Used db.sqlite3


DATABASES = {
  'default': {
      'ENGINE': 'django.db.backends.sqlite3',
      'NAME':os.path.join(BASE_DIR, 'db.sqlite3'),
  }
}

how to fix problem?

Most likely cause is that the account being used to run your Django instance doesn’t have permissions to write to that file.

That database should be owned by that account. (“www-data” perhaps?)