Django external databases

Hello, I am new to Django and especially new to hosting and connecting external databases. I tried building a website where you can visualize meteorological data from the Deutscher WetterDienst. That database is a managed readonly database on Digital Ocean.

When I run runserver locally it looks like this:

And when I try to get the same visualisations when accessing the hosted website (Gunicorn & Nginx)
You can visit the website here:

I get a “django.db.utils.OperationalError: attempt to write a read only database”

Even though no code has changed when hosting the Django project.

Can someone please help me or point me in the right direction?

Please post your database settings, obscuring or removing any passwords.

My initial reaction to this is that the problem is probably with your Django database, not the external database you’re trying to reference.

Hi Ken,

Here are my database settings:

‘default’: {
‘ENGINE’: ‘django.db.backends.sqlite3’,
‘NAME’: BASE_DIR / ‘databases/db.sqlite3’,
‘dwd’: {
‘ENGINE’: ‘mysql.connector.django’,
‘PORT’: 25060,
‘OPTIONS’: {‘ssl’: {‘ca’: f’/{path}/.ssl/do-mdb-ca-certificate.crt’}},

What uid (user) is gunicorn running as? Does that account have access to your databases directory?

“aeolis” is the user of gunicorn.

I changed the rights to the databases directory using chmod 664 and it worked!

Here are the rights to the databases directory
-rw-rw-r–. 1 aeolis aeolis 1417216 Oct 12 08:00 db.sqlite3
-rw-rw-r–. 1 aeolis aeolis 1417216 Oct 12 08:00 databases/db.sqlite3

Thank you so much!!