mirror of
https://github.com/capricornxl/ad-password-self-service.git
synced 2025-08-12 01:44:58 +08:00
dynamic create crypto_key when django running
This commit is contained in:
@@ -5,6 +5,7 @@ from django_redis import get_redis_connection
|
||||
|
||||
from utils.storage.memorystorage import MemoryStorage
|
||||
from utils.storage.kvstorage import KvStorage
|
||||
from cryptography.fernet import Fernet
|
||||
|
||||
try:
|
||||
redis_conn = get_redis_connection()
|
||||
@@ -18,3 +19,5 @@ except Exception as e:
|
||||
print("如果确定需要使用Redis作为缓存,请排查Redis配置,错误信息如下:")
|
||||
print("Redis Exception: {}".format(e))
|
||||
|
||||
|
||||
crypto_key = Fernet.generate_key()
|
||||
|
Reference in New Issue
Block a user