G
G
GlamorousCar2021-01-13 22:27:54
Django
GlamorousCar, 2021-01-13 22:27:54

How to upload secret_key (Django) to server?

Good afternoon. I read that the best practice for storing secret keys in Django is environment variables. So I added this key to /etc/envi...
In the project, in settings now this line Next, I need to upload the project to the server. First, I upload it to git, then I clone it to the server. But the key then remained on the machine where the development was carried out. For some reason, the process of how to transfer the key is not described anywhere, or does a new one need to be created? Please explain what to do?
SECRET_KEY = os.getenv('SECRET_KEY')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-01-13
@GlamorousCar

It is not described anywhere because it is not necessary to transfer it. The key must be unique to the host.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question