From 3bbb65b2d7b5bb28e136335102946d06dbefe601 Mon Sep 17 00:00:00 2001 From: Alessandro Gervaso Date: Mon, 22 Jun 2020 11:41:14 +0200 Subject: [PATCH] add parsing of dict-string STORAGE_CONFIG must be converted from string to a Dictionary, only if STORAGE_BACKEND is defined. --- configuration/configuration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configuration/configuration.py b/configuration/configuration.py index 0f38f4c..dd311c2 100644 --- a/configuration/configuration.py +++ b/configuration/configuration.py @@ -208,7 +208,9 @@ STORAGE_BACKEND = os.environ.get('STORAGE_BACKEND', None) # A dictionary of configuration parameters for the storage backend configured as STORAGE_BACKEND. The specific # parameters to be used here are specific to each backend; see the django-storages documentation for more detail. # If STORAGE_BACKEND is not defined, this setting will be ignored. -STORAGE_CONFIG = os.environ.get('STORAGE_CONFIG', None) +if STORAGE_BACKEND: + import ast + STORAGE_CONFIG = ast.literal_eval(os.environ.get('STORAGE_CONFIG', "{}")) # Time zone (default: UTC) TIME_ZONE = os.environ.get('TIME_ZONE', 'UTC')