Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
course-discovery
Commits
3b42b765
Commit
3b42b765
authored
Dec 11, 2016
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated name of environment file
ECOM-6590
parent
d1b08ef4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
15 deletions
+7
-15
course_discovery/settings/production.py
+7
-3
course_discovery/settings/utils.py
+0
-12
No files found.
course_discovery/settings/production.py
View file @
3b42b765
...
@@ -6,7 +6,6 @@ import MySQLdb
...
@@ -6,7 +6,6 @@ import MySQLdb
import
yaml
import
yaml
from
course_discovery.settings.base
import
*
from
course_discovery.settings.base
import
*
from
course_discovery.settings.utils
import
get_env_setting
DEBUG
=
False
DEBUG
=
False
TEMPLATE_DEBUG
=
DEBUG
TEMPLATE_DEBUG
=
DEBUG
...
@@ -22,7 +21,13 @@ DICT_UPDATE_KEYS = ('JWT_AUTH',)
...
@@ -22,7 +21,13 @@ DICT_UPDATE_KEYS = ('JWT_AUTH',)
# This may be overridden by the YAML in DISCOVERY_CFG, but it should be here as a default.
# This may be overridden by the YAML in DISCOVERY_CFG, but it should be here as a default.
MEDIA_STORAGE_BACKEND
=
{}
MEDIA_STORAGE_BACKEND
=
{}
CONFIG_FILE
=
get_env_setting
(
'COURSE_DISCOVERY_CFG'
)
# TODO Drop the try-except block once https://github.com/edx/configuration/pull/3549 is merged and we are using the
# common play for this service.
try
:
CONFIG_FILE
=
environ
[
'DISCOVERY_CFG'
]
except
KeyError
:
CONFIG_FILE
=
environ
[
'COURSE_DISCOVERY_CFG'
]
with
open
(
CONFIG_FILE
)
as
f
:
with
open
(
CONFIG_FILE
)
as
f
:
config_from_yaml
=
yaml
.
load
(
f
)
config_from_yaml
=
yaml
.
load
(
f
)
...
@@ -40,7 +45,6 @@ with open(CONFIG_FILE) as f:
...
@@ -40,7 +45,6 @@ with open(CONFIG_FILE) as f:
# It's important we unpack here because of https://github.com/edx/configuration/pull/3307
# It's important we unpack here because of https://github.com/edx/configuration/pull/3307
vars
()
.
update
(
MEDIA_STORAGE_BACKEND
)
vars
()
.
update
(
MEDIA_STORAGE_BACKEND
)
if
'EXTRA_APPS'
in
locals
():
if
'EXTRA_APPS'
in
locals
():
INSTALLED_APPS
+=
EXTRA_APPS
INSTALLED_APPS
+=
EXTRA_APPS
...
...
course_discovery/settings/utils.py
deleted
100644 → 0
View file @
d1b08ef4
from
os
import
environ
from
django.core.exceptions
import
ImproperlyConfigured
def
get_env_setting
(
setting
):
""" Get the environment setting or raise exception """
try
:
return
environ
[
setting
]
except
KeyError
:
error_msg
=
"Set the [{}] env variable!"
.
format
(
setting
)
raise
ImproperlyConfigured
(
error_msg
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment