6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 06:07:56 +00:00

Simplify common openedx settings management

Use "{% include %}" jinja directive instead of python "exec", which was
a bit weird.

Also, this sets the technical email for the studio, which was previous
set at "technical@example.com".
This commit is contained in:
Régis Behmo 2019-10-17 10:22:04 +02:00
parent 5675af4d42
commit e539f31504
7 changed files with 28 additions and 32 deletions

View File

@ -1,9 +1,7 @@
import os
from cms.envs.devstack import *
# Execute the contents of common.py in this context
execfile(os.path.join(os.path.dirname(__file__), "common.py"), globals())
{% include "apps/openedx/settings/partials/common/lms.py" %}
# Setup correct webpack configuration file for development
WEBPACK_CONFIG_PATH = "webpack.dev.config.js"

View File

@ -1,9 +1,7 @@
import os
from cms.envs.production import *
# Execute the contents of common.py in this context
execfile(os.path.join(os.path.dirname(__file__), "common.py"), globals())
{% include "apps/openedx/settings/partials/common/cms.py" %}
ALLOWED_HOSTS = [
ENV_TOKENS.get("CMS_BASE"),
@ -12,7 +10,3 @@ ALLOWED_HOSTS = [
"localhost",
"studio.localhost",
]
DEFAULT_FROM_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
SERVER_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]

View File

@ -1,10 +1,7 @@
import os
from lms.envs.devstack import *
# Execute the contents of common.py in this context
execfile(os.path.join(os.path.dirname(__file__), "common.py"), globals())
{% include "apps/openedx/settings/partials/common/cms.py" %}
# Setup correct webpack configuration file for development
WEBPACK_CONFIG_PATH = "webpack.dev.config.js"

View File

@ -1,9 +1,7 @@
import os
from lms.envs.production import *
# Execute the contents of common.py in this context
execfile(os.path.join(os.path.dirname(__file__), "common.py"), globals())
{% include "apps/openedx/settings/partials/common/lms.py" %}
ALLOWED_HOSTS = [
ENV_TOKENS.get("LMS_BASE"),
@ -19,16 +17,3 @@ SEARCH_SKIP_ENROLLMENT_START_DATE_FILTERING = True
# Allow insecure oauth2 for local interaction with local containers
OAUTH_ENFORCE_SECURE = False
DEFAULT_FROM_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
SERVER_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
TECH_SUPPORT_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
CONTACT_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
BUGS_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
UNIVERSITY_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
PRESS_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
PAYMENT_SUPPORT_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
BULK_EMAIL_DEFAULT_FROM_EMAIL = "no-reply@" + ENV_TOKENS["LMS_BASE"]
API_ACCESS_MANAGER_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
API_ACCESS_FROM_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]

View File

@ -0,0 +1,12 @@
DEFAULT_FROM_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
SERVER_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
TECH_SUPPORT_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
CONTACT_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
BUGS_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
UNIVERSITY_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
PRESS_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
PAYMENT_SUPPORT_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
BULK_EMAIL_DEFAULT_FROM_EMAIL = "no-reply@" + ENV_TOKENS["LMS_BASE"]
API_ACCESS_MANAGER_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]
API_ACCESS_FROM_EMAIL = ENV_TOKENS["CONTACT_EMAIL"]

View File

@ -1,3 +1,7 @@
{% include "apps/openedx/settings/partials/common/all.py" %}
######## Common CMS settings
# Load module store settings from config files
update_module_store_settings(MODULESTORE, doc_store_settings=DOC_STORE_CONFIG)
@ -35,3 +39,5 @@ for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]:
{{ patch("openedx-common-settings") }}
{{ patch("openedx-cms-common-settings") }}
######## End of common CMS settings

View File

@ -1,5 +1,7 @@
"""File with configurations for lms common between production and development.
"""
{% include "apps/openedx/settings/partials/common/all.py" %}
######## Common LMS settings
# Load module store settings from config files
update_module_store_settings(MODULESTORE, doc_store_settings=DOC_STORE_CONFIG)
@ -60,3 +62,5 @@ for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE, ORA2_FILEUPLOAD_ROOT]:
{{ patch("openedx-common-settings") }}
{{ patch("openedx-lms-common-settings") }}
######## End of common LMS settings