diff --git a/README.rst b/README.rst index 6f832ef..f559de7 100644 --- a/README.rst +++ b/README.rst @@ -53,3 +53,16 @@ Re-indexing courses tutor local run discovery ./manage.py refresh_course_metadata tutor local run discovery ./manage.py update_index --disable-change-limit + +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 \ + --service_username=lms_catalog_service_user + +Then:: + + tutor local run lms ./manage.py lms cache_programs \ No newline at end of file diff --git a/tutordiscovery/templates/discovery/hooks/lms/init b/tutordiscovery/templates/discovery/hooks/lms/init index 6344954..4903b5e 100644 --- a/tutordiscovery/templates/discovery/hooks/lms/init +++ b/tutordiscovery/templates/discovery/hooks/lms/init @@ -1,6 +1,9 @@ -./manage.py lms --settings=tutor.production manage_user discovery discovery@{{ LMS_HOST }} --staff --superuser +export DJANGO_SETTINGS_MODULE=$SERVICE_VARIANT.envs.$SETTINGS -./manage.py lms --settings=tutor.production create_oauth2_client \ +./manage.py lms manage_user discovery discovery@{{ LMS_HOST }} --staff --superuser +./manage.py lms manage_user lms_catalog_service_user lms_catalog_service_user@{{ LMS_HOST }} + +./manage.py lms create_oauth2_client \ "{% if ACTIVATE_HTTPS %}https{% else %}http{% endif %}://{{ DISCOVERY_HOST }}" \ "{% if ACTIVATE_HTTPS %}https{% else %}http{% endif %}://{{ DISCOVERY_HOST }}/complete/edx-oidc/" \ confidential \