diff --git a/README.md b/README.md index 1ce8a1f..0a65bd1 100644 --- a/README.md +++ b/README.md @@ -46,12 +46,9 @@ This sample plugin showcases the **Open edX Hooks Extension Framework**, which a ### Option 1: Development with Tutor (Recommended) ```bash -# Backend Plugin Setup -tutor mounts add lms:$PWD/backend:/openedx/sample-plugin-backend -tutor dev launch -tutor dev exec lms pip install -e ../sample-plugin-backend -tutor dev exec lms python manage.py lms migrate -tutor dev restart lms +# Backend plugin setup +tutor mounts add "$PWD/backend" +tutor dev launch # Rebuilds image, runs migrations, reboots containers. # Frontend Plugin Setup (for learner-dashboard MFE development) npm install $PWD/frontend diff --git a/tutor/tutorsampleplugin/plugin.py b/tutor/tutorsampleplugin/plugin.py index 3ed7689..0c6e7e4 100644 --- a/tutor/tutorsampleplugin/plugin.py +++ b/tutor/tutorsampleplugin/plugin.py @@ -21,10 +21,17 @@ # --------------------------------------------------------------------------- # Backend: Install the Django app plugin into LMS and CMS images # --------------------------------------------------------------------------- + +# If a directory named "backend" has been moutned with `tutor mount add`, then +# this line will ensure that the directory gets mapped into the openedx[-dev] +# image and into the container's virtualenv. When there is no such directory +# mounted, this line has no effect (thus it's safe for it to exist in the +# production version of the plugin). +hooks.Filters.MOUNTED_DIRECTORIES.add_item(("openedx", "backend")) + # The openedx-dockerfile-post-python-requirements patch runs after pip # installs the base Open edX requirements. Plugins installed here are # available in both LMS and CMS containers. -# --------------------------------------------------------------------------- hooks.Filters.ENV_PATCHES.add_item(( "openedx-dockerfile-post-python-requirements",