S
S
Stanislav Shabalin2020-09-07 10:20:00
Django
Stanislav Shabalin, 2020-09-07 10:20:00

Replacing SECRET_KEY in production?

Connoisseurs, tell me, is it possible to transfer the secret key and setrtings.py in general (with the latest changes in media, static, allowed host) to production?

Why did you doubt? when I read about deploying with git, I don’t remember that it was recommended not to touch this key, but I deployed the project traditionally through startproject. In the SECRET_KEY settings it is very different from the local key. What to do here, do you need to protect it when creating it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-09-07
@Starck43

You need to take care, all passwords, SECRET_KEY and other sensitive information are not stored in git, but are set, for example, through environment variables: or use either
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question