diff --git a/README.rst b/README.rst index 2f6e800..af245c0 100644 --- a/README.rst +++ b/README.rst @@ -70,13 +70,15 @@ Caching programs In order to cache programs in the LMS, you will need to manually create a catalog integration. This step should be performed just once:: tutor local run lms ./manage.py lms create_catalog_integrations --enabled \ - --internal_api_url=http://discovery:8000/api/v1 \ + --internal_api_url="" \ --service_username=lms_catalog_service_user Then:: tutor local run lms ./manage.py lms cache_programs +This last step should be performed every time you create new or make changes to existing programs. + Debugging --------- diff --git a/tutordiscovery/patches/local-docker-compose-dev-services b/tutordiscovery/patches/local-docker-compose-dev-services index 607bf02..12ff8f9 100644 --- a/tutordiscovery/patches/local-docker-compose-dev-services +++ b/tutordiscovery/patches/local-docker-compose-dev-services @@ -7,4 +7,4 @@ discovery: networks: default: aliases: - - "{{ DISCOVERY_HOST }}" \ No newline at end of file + - "{{ DISCOVERY_HOST }}" diff --git a/tutordiscovery/patches/openedx-lms-common-settings b/tutordiscovery/patches/openedx-lms-common-settings index ad73806..4257fc2 100644 --- a/tutordiscovery/patches/openedx-lms-common-settings +++ b/tutordiscovery/patches/openedx-lms-common-settings @@ -1,2 +1 @@ FEATURES["ENABLE_COURSE_DISCOVERY"] = True -COURSE_CATALOG_API_URL = "http://discovery:8000/api/v1" \ No newline at end of file diff --git a/tutordiscovery/templates/discovery/apps/settings/tutor/development.py b/tutordiscovery/templates/discovery/apps/settings/tutor/development.py index 9c19633..9de215e 100644 --- a/tutordiscovery/templates/discovery/apps/settings/tutor/development.py +++ b/tutordiscovery/templates/discovery/apps/settings/tutor/development.py @@ -13,4 +13,7 @@ SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = SOCIAL_AUTH_EDX_OAUTH2_ISSUER SOCIAL_AUTH_EDX_OAUTH2_PUBLIC_URL_ROOT = SOCIAL_AUTH_EDX_OAUTH2_ISSUER SOCIAL_AUTH_EDX_OAUTH2_LOGOUT_URL = SOCIAL_AUTH_EDX_OAUTH2_ISSUER + "/logout" +# Disable API caching, which makes it a pain to troubleshoot issues +USE_API_CACHING = False + {{ patch("discovery-development-settings") }} diff --git a/tutordiscovery/templates/discovery/hooks/lms/init b/tutordiscovery/templates/discovery/hooks/lms/init index 4188d46..ef5be37 100644 --- a/tutordiscovery/templates/discovery/hooks/lms/init +++ b/tutordiscovery/templates/discovery/hooks/lms/init @@ -52,3 +52,10 @@ --update \ discovery-sso \ discovery + +# The COURSE_CATALOG_API_URL used to be stored in a setting, but is now a site +# configuration -- which means that it takes different values for different +# sites. This is important because the programs and courses returned for each +# site will differ. +site-configuration set -d {{ LMS_HOST }} COURSE_CATALOG_API_URL {% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ DISCOVERY_HOST }}/api/v1 +site-configuration set -d {{ LMS_HOST }}:8000 COURSE_CATALOG_API_URL http://{{ DISCOVERY_HOST }}:8381/api/v1