Changing secret key

Hi,

I am migrating my application to kubernetes. I’m using Pipelines to deploy my app, but when i try to pass in the secert key as an environment variable i get and error cause the secret key contains special characters and it seems the the yml doesn’t like it.

I can escape the special characters to make it work, but im worried if i make a mistake on the escaping the chartacters what will happen?

I know that it will potentially log the users out, and password reset links wont work. But is there anything major i need to think about?

My main concern is anything to do with the data in the database?

Thanks

What the SECRET_KEY is used for is described in the docs.

No. The secret key is in no way related to anything in your database.

Hey there Ken! I’ve been facing an issue recently where I changed my secret key from an environment variable to auto-generating one using django.core.management.utils.get_random_secret_key on app startup. I use my app as an API (via DRF) and a FE app consumes from it, and now no user can refresh their JWT token (rest_framework_simplejwt.views.TokenRefreshView from the djangorestframework-simplejwt lib), as it throws HTTP 401 every time. If I switch the secret key back to the env variable one it gets back to working. Do you know what could be happening and how I can fix it?