Commit c70bd5d7 by Tim Babych

make things work (through refusing everyone) when DB is not available

parent a8498200
......@@ -48,7 +48,13 @@ CONFIG_ROOT = os.environ.get('CONFIG_ROOT', "/edx/app/edxapp")
# prefix.
CONFIG_PREFIX = SERVICE_VARIANT + "." if SERVICE_VARIANT else ""
with open(os.path.join(CONFIG_ROOT, CONFIG_PREFIX + "auth.json")) as auth_file:
AUTH_TOKENS = json.load(auth_file)
DATABASES = AUTH_TOKENS['DATABASES']
\ No newline at end of file
try:
with open(os.path.join(CONFIG_ROOT, CONFIG_PREFIX + "auth.json")) as auth_file:
AUTH_TOKENS = json.load(auth_file)
DATABASES = AUTH_TOKENS['DATABASES']
except IOError:
DATABASES = {'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment