about summary refs log tree commit diff
path: root/gn3
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-04-08 12:53:00 -0500
committerFrederick Muriuki Muriithi2025-04-08 14:19:56 -0500
commite0ee2ddf154bb21a487f92994e27d411a477d7e9 (patch)
tree6f3cf9af903c9bbf898a4509fdc06519a654a710 /gn3
parent1c944a7f890da1a40995eb37624e4b72676b6f76 (diff)
downloadgenenetwork3-e0ee2ddf154bb21a487f92994e27d411a477d7e9.tar.gz
APPLICATION_ENVIRONMENT: New configuration variable
Add a new application configuration variable,
"APPLICATION_ENVIRONMENT" that will be useful to distinguish resources
for different instances of the application that might run on the same
host. The default value is an empty string in order to allow backwards
compatibility with existing code.

An example of where this finds utility: If you run multiple instances
of the application, but they all share the same redis instance, then
key-collisions from the different running applications will happen,
leading to subtle, difficult to troubleshoot bugs.
Diffstat (limited to 'gn3')
-rw-r--r--gn3/settings.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/gn3/settings.py b/gn3/settings.py
index e988106..028f083 100644
--- a/gn3/settings.py
+++ b/gn3/settings.py
@@ -7,6 +7,13 @@ application settings.
 import os
 import tempfile
 
+### APPLICATION_ENVIRONMENT: can be something like
+### production, staging, development, tux02-prod, tux04-staging, etc.
+### Useful to distinguish resources for different containers if you run multiple
+## containers on the same host e.g. distinguish keys on a redis instance for
+## different containers.
+APPLICATION_ENVIRONMENT = ""
+
 DATA_DIR = ""
 GEMMA_WRAPPER_CMD = os.environ.get("GEMMA_WRAPPER", "gemma-wrapper")
 CACHEDIR = ""