Y
Y
YuriyCherniy2020-04-30 17:57:48
Django
YuriyCherniy, 2020-04-30 17:57:48

Is it a bad idea to change SECRET_KEY in a Django project every time the server is restarted?

Many sources say that storing SECRET_KEY in environment variables is one of the best approaches. But the variables set by the user are stored there only until the next reboot of the environment if you set them directly: Is it a bad idea to change SECRET_KEY every time the server is restarted? The project requires the ability to run on different machines, by different users without having to write SECRET_KEY by hand. os.environ['SECRET_KEY'] = 'some_string'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2020-04-30
@YuriyCherniy

Bad. All tokens and signatures where it is used will become invalid . Of the frequently used ones, these are password reset tokens.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question