From ed10c120632ba6330660acb713c197175b3c58c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Rodr=C3=ADguez?= Date: Mon, 9 Mar 2020 17:42:58 +0100 Subject: [PATCH] Use TIME_ZONE environment variable when available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Connects to https://github.com/archivematica/Issues/issues/291 Co-authored-by: Jesús García Crespo --- install/README.md | 5 +++++ storage_service/storage_service/settings/base.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/install/README.md b/install/README.md index c7628ef31..1f3c7ed0a 100644 --- a/install/README.md +++ b/install/README.md @@ -59,6 +59,11 @@ of these settings or provide values to mandatory fields. - **Type:** `string` - :red_circle: **Mandatory!** +- **`TIME_ZONE`**: + - **Description:** application time zone. See [TIME_ZONE](https://docs.djangoproject.com/en/1.8/ref/settings/#time-zone) for more details. + - **Type:** `string` + - **Default:** `"America/Los_Angeles"` + - **`SECRET_KEY`**: - **Description:** a secret key used for cryptographic signing. See [SECRET_KEY](https://docs.djangoproject.com/en/1.8/ref/settings/#secret-key) for more details. - **Type:** `string` diff --git a/storage_service/storage_service/settings/base.py b/storage_service/storage_service/settings/base.py index 8d67db526..c48e1bb58 100644 --- a/storage_service/storage_service/settings/base.py +++ b/storage_service/storage_service/settings/base.py @@ -67,7 +67,7 @@ def get_env_variable(var_name): # ######## GENERAL CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#time-zone -TIME_ZONE = "America/Los_Angeles" +TIME_ZONE = environ.get("TIME_ZONE", "America/Los_Angeles") # See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code LANGUAGE_CODE = "en-us"