Django SECRET_KEY在分布式设置中 [英] Django SECRET_KEY in a distributed setup

查看:96
本文介绍了Django SECRET_KEY在分布式设置中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在一个负载平衡器后面设置了多个django服务器,我想要SECRET_KEY是一样的,不同的还是很重要的?这个文件对于这个值来说有点薄。

If I am setting up multiple django servers behind a load balancer, do I want the SECRET_KEY to be the same, different or does it matter at all? The docs are a little thin on exactly what this value is used for.

推荐答案

我想这一定是一样的。以下是相关问题: Django SECRET_KEY

I guess it must be the same. Here is related question: Django SECRET_KEY.

基本秘密密钥用于验证发送给客户端或进入会话的各种事项。所以如果你的节点有不同的秘密密钥,那么每次路由到新的节点时都会清除客户端的会话(这是坏的)。

Basically secret key is used to validate various things send to client or put in session. So if your nodes would have different secret keys you would have client's session cleared everytime it is routed to new node (which is bad).

这篇关于Django SECRET_KEY在分布式设置中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆