I am trying to create a python package to add custom course tab. I have created scaffold using tutor cookiecutter. Have followed some code hacks from discussion openedx app. In setup.py I have following entry points:
After installing plugin with pip install, the plugin does shows up in tutor plugins list and I have also enabled it. But the course tab does not appear on Course page.
I have seen some third party plugins and they all require adding it in $(tutor config printroot)/env/build/openedx/requirements/private.txt. I don’t know how to do that with tutor plugin I created because my plugin is not on git repo and using pip install locally on my local server.
A course tab operates similarly to an xblock, in terms of installing and enabling it. You use the requirements folder to build it into the image, and then you have to put the project name in the course’s Advanced Module List to display it in a course. The course tab should then display in the studio Content > Pages list.
Regardless of enabling the tab in the course, you can also access the tab directly using the URL specified in the urls.py file because openedx.course_tab registers the tab globally (I think).
This is correct. You have to build the images in dev mode to install the XBlocks or Django app. Then, you can start to work on your project. The system will recompile the code when it detects a change.
Because building the images takes so much time, I just start the full dev stack (CMS, LMS, and learning) and just leave it running in the background on my dev box. tutor dev start -d > ~/tutor-build-log.txt 2>&1
You can watch the output or dump print messages there, such as: tutor dev logs cms lms --tail 50 -f
You should first download the code and place in the requirements folder, like this:
# Change to the requirements directory
cd $(tutor config printroot)/env/build/openedx/requirements
# Clone a project
git clone https://github.com/some-user/some-project.git
# Add the project reference to include the Open edX images
echo "-e ./some-project/" >> private.txt
The code that you update in the development platform does not automatically sync back to GitHub. You can push code back to your GitHub project when you are ready to make a commit either from the requirements folder (using the command like) or copy the code back to your desktop environment and use the GUI.
I recommend reading the Tutor help docs on Open edX Development, specifically the section called “XBlock and edx-platform plugin development”.
You can start the full dev stack in detached/daemon mode using the command shown below. Tutor will run in the background until you stop it. Stopping it generally triggers the image rebuild process, which is why I rarely stop it during active development.
tutor dev start -d
Once running, the file watcher will trigger a recompile of the .py files upon change. You can then refresh the page in your browser to view the change. You can view the container logs (and follow them) using: