Skip to content

Commit 9c7fe4e

Browse files
author
Matthew Fisher
committed
fix(local_settings.py): read DATABASES from settings.py
This fix renames and moves confd_settings.py to local_settings.py within the container. This allows us to import the generic settings.py and overwrite existing values, allowing the database settings to be overwritten.
1 parent e90e671 commit 9c7fe4e

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[template]
2-
src = "confd_settings.py"
3-
dest = "/templates/confd_settings.py"
2+
src = "local_settings.py"
3+
dest = "/app/deis/local_settings.py"
44
uid = 1000
55
gid = 1000
66
mode = "0640"

rootfs/deis/settings.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os.path
66
import random
77
import string
8-
import sys
98
import tempfile
109

1110
# A boolean that turns on/off debug mode.
@@ -301,9 +300,3 @@
301300
from .local_settings import * # noqa
302301
except ImportError:
303302
pass
304-
305-
# have confd_settings within container execution override all others
306-
# including local_settings (which may end up in the container)
307-
if os.path.exists('/templates/confd_settings.py'):
308-
sys.path.append('/templates')
309-
from confd_settings import * # noqa
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import os
22

3+
from .settings import *
4+
35
# security keys and auth tokens
46
with open('/var/run/secrets/api/builder/auth/builder-key') as f:
57
BUILDER_KEY = f.read().strip()

0 commit comments

Comments
 (0)