🔧(backend) make data directory location configurable via env var
Add environment variable to control data directory location when building outside of Docker. Improves flexibility for non-containerized deployments where storing data at filesystem root is inappropriate or undesirable.
This commit is contained in:
committed by
aleb_the_flash
parent
bc53916c68
commit
c4fe341a74
@@ -23,7 +23,6 @@ from sentry_sdk.integrations.logging import ignore_logger
|
|||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
DATA_DIR = os.path.join("/", "data")
|
|
||||||
|
|
||||||
|
|
||||||
def get_release():
|
def get_release():
|
||||||
@@ -70,6 +69,8 @@ class Base(Configuration):
|
|||||||
|
|
||||||
API_VERSION = "v1.0"
|
API_VERSION = "v1.0"
|
||||||
|
|
||||||
|
DATA_DIR = values.Value(os.path.join("/", "data"), environ_name="DATA_DIR")
|
||||||
|
|
||||||
# Security
|
# Security
|
||||||
ALLOWED_HOSTS = values.ListValue([])
|
ALLOWED_HOSTS = values.ListValue([])
|
||||||
SECRET_KEY = values.Value(None)
|
SECRET_KEY = values.Value(None)
|
||||||
|
|||||||
Reference in New Issue
Block a user