Giter Site home page Giter Site logo

tutor-discovery's Introduction

Course Discovery plugin for Tutor

This is a plugin for Tutor that integrates the Course Discovery application in an Open edX platform. it is useful for integration with, for example, Ecommerce or an external course catalog.

E-ducation

This plugin was developed and open sourced to the community thanks to the generous support of E-ducation. Thank you!

Installation

This plugin requires tutor>=3.6.0. If you have installed tutor from a pre-compiled binary, it already comes bundled with the discovery plugin. Otherwise:

pip install tutor-discovery

Then, to enable this plugin, run:

tutor plugins enable discovery

You will have to re-generate the environment:

tutor config save

The, run migrations:

tutor local init

This last step is unnecessary if you run instead tutor local quickstart.

Operations

Creating a user

The discovery user interface will be available at http://discovery.local.overhang.io for a local test instance, and at DISCOVERY_HOST (by default: http(s)://discovery.<your lms host>) in production. In order to run commands from the UI, a user must be created:

tutor local run discovery ./manage.py createsuperuser

Then, you must login with this user at http://discovery.local.overhang.io/admin.

Alternatively, you can login with oauth2 using a pre-existing user created on the LMS/CMS by accessing http(s)://discovery.<your lms host>/login. To do so, the proper domain names must exist and point to the production server.

Index configuration

Discovery uses separate indices for different models (the names are: course, course_run, person and program by default). And you can overwrite theses names by configuring DISCOVERY_INDEX_OVERRIDES:

DISCOVERY_INDEX_OVERRIDES:
  course_discovery.apps.course_metadata.search_indexes.documents.course: your-course-index-name
  course_discovery.apps.course_metadata.search_indexes.documents.course_run: your-course-run-index-name
  course_discovery.apps.course_metadata.search_indexes.documents.person: your-person-index-name
  course_discovery.apps.course_metadata.search_indexes.documents.program: your-program-index-name

Re-indexing courses

tutor local run discovery ./manage.py refresh_course_metadata --partner_code=openedx
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="" \
    --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

To debug the course discovery service, you are encouraged to mount the course-discovery repo from the host in the development container:

tutor dev runserver -v ~/projets/openedx/repos/course-discovery/:/openedx/discovery discovery

You can then access the development server at http://discovery.local.overhang.io:8381. Feel free to add breakpoints (import pdb; pdb.set_trace()) anywhere in your source code to debug your application.

Alternatively, you may bind-mount a local course-discovery repository by adding the following to $(tutor config printroot)/env/dev/docker-compose.override.yml:

version: "3.7"
services:
    discovery:
        volumes:
            - /path/to/course-discovery/:/openedx/discovery

Once a local repository is mounted in the image, you will have to install nodejs dependencies and collect static assets:

tutor dev run discovery npm install --development
tutor dev run discovery make static.dev

License

This work is licensed under the terms of the GNU Affero General Public License (AGPL).

tutor-discovery's People

Contributors

regisb avatar pcliupc avatar cacciaresi avatar mafonso avatar hocndh-1784 avatar bbrsofiane avatar sodaling avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.