How to reload Django configuration in a Docker container?

I have a self-hosted instance in a Docker container. I’m trying to debug an issue (this one) and I would like to be able to make adjustments to the Django project configuration to help with debugging.

I know how to set environment variables when starting the container, but only a few of the Django configuration variables can be manipulated by setting environment variables (I think).

I know how to edit the configuration file at

/baserow/backend/src/baserow/config/settings/base.py

but I don’t know how to make the running Django application load those changes.

In other contexts I typically serve the dynamic parts of a Django application using Gunicorn, and in those cases in order to reload the configuration I would restart the Gunicorn service.

But it doesn’t look like the Django application is being served by Gunicorn, or any other system I’m familiar with.

How can I make changes to the config/settings/base.py file take effect?

Thanks.

Hi @hugh,

I hope my answer to your other issue (this one ) helps you fix the problem.

The best way to have hot-reloading and debug settings/changes in Baserow is by running a dev environment. You can do it by following this guide: https://baserow.io/docs/development/running-the-dev-environment

2 Likes

Hi @davide your solution to my other problem did indeed fix my issue!

In case anyone else has this same question, I’d like to confirm before I mark this resolved: is there indeed no way to reload the configuration of a running production instance?

I’d say restarting the container or manually killing/restarting the process in the backend container.

Thanks @davide.

I’m not very knowledgeable about Docker containers. But I think if I restart the container any changes I made to the in-place configuration file would be reverted?

Killing and restarting the service in the backend is what I’d like to be able to do, but I’m not sure how to do that in a running baserow/baserow:1.16.0 container.

In an Ubuntu host serving Django with gunicorn/nginx, I would normally do something like

service gunicorn restart

But when I check

service --status-all

in the running container, I don’t see gunicorn or anything else that looks like it might be a Django-serving service that I could restart.

Is there another command?