Skip to content

Commit

Permalink
fix: fix base url for the media file links
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Faraz Maqsood authored and Muhammad Faraz Maqsood committed Dec 7, 2023
1 parent 0d9eb05 commit 73ca49f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tutordiscovery/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
HERE = os.path.abspath(os.path.dirname(__file__))
REPO_NAME = "course-discovery"
APP_NAME = "discovery"
PROTOCOL = "https" if "{{ENABLE_HTTPS}}" else "http"

config: t.Dict[str, t.Dict[str, t.Any]] = {
"defaults": {
Expand All @@ -34,13 +35,19 @@
"EXTRA_PIP_REQUIREMENTS": [],
"REPOSITORY": "https://github.com/openedx/course-discovery.git",
"REPOSITORY_VERSION": "{{ OPENEDX_COMMON_VERSION }}",
"DEV_BASE_URL": "http://{{DISCOVERY_HOST}}:8381",
"DEV_MEDIA_URL": "http://{{DISCOVERY_HOST}}:8381/media/"
},
"unique": {
"MYSQL_PASSWORD": "{{ 8|random_string }}",
"SECRET_KEY": "{{ 20|random_string }}",
"OAUTH2_SECRET": "{{ 8|random_string }}",
"OAUTH2_SECRET_SSO": "{{ 8|random_string }}",
},
"overrides": {
"DISCOVERY_BASE_URL": PROTOCOL + "://{{DISCOVERY_HOST}}",
"MEDIA_URL": PROTOCOL + "://{{DISCOVERY_HOST}}/media/",
}
}

# Initialization tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@
# Disable API caching, which makes it a pain to troubleshoot issues
USE_API_CACHING = False

DISCOVERY_BASE_URL = "{{ DISCOVERY_DEV_BASE_URL }}"
MEDIA_URL = "{{ DISCOVERY_DEV_MEDIA_URL }}"

{{ patch("discovery-development-settings") }}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@

SOCIAL_AUTH_REDIRECT_IS_HTTPS = {% if ENABLE_HTTPS %}True{% else %}False{% endif %}

DISCOVERY_BASE_URL = "{{ DISCOVERY_BASE_URL }}"
MEDIA_URL = "{{ MEDIA_URL }}"

{{ patch("discovery-production-settings") }}

0 comments on commit 73ca49f

Please sign in to comment.