- Ensure you have (Kolibri)[https://github.com/learningequality/kolibri] setup for local development. Note that all commands below are to be done in the Kolibri repo unless specified otherwise. Also, be sure you're checking out the correct version branch. As of August 2020, this would be
release-v0.12.x
. git clone
thiskolibri_instant_schools_plugin
repository and thencd
back into where you setup your Kolibri for development.- Set and export the following local variables for use in your development environment:
KOLIBRI_HOME
- this ought to be a new path that was not previously used as aKOLIBRI_HOME
. Also setDJANGO_SETTINGS_MODULE
tokolibri_instant_schools_plugin.instant_schools_settings
. - Run
pip install -e ../relative/path/to/kolibri_instant_schools_plugin
- Run
kolibri manage migrate --database=instant_schools
- Run
kolibri plugin kolibri_instant_schools_plugin enable
andkolibri plugin kolibri.plugins.user disable
. If you find that you're having issues, see the next item. - As an alternative to item 6 above, we may instead use plugins files and update our package.json scripts TEMPORARILY in our local Kolibri. Do not commit these changes to Kolibri.
Make your build_tools/build_plugins.txt
read as follows and remember that this is TEMPORARY and should not be committed to Kolibri:
kolibri.core
kolibri.plugins.device_management
kolibri.plugins.facility_management
kolibri.plugins.learn
kolibri.plugins.document_pdf_render
kolibri.plugins.html5_app_renderer
kolibri.plugins.media_player
kolibri.plugins.setup_wizard
kolibri.plugins.coach
kolibri_exercise_perseus_plugin
kolibri_instant_schools_plugin
kolibri.plugins.style_guide
kolibri.plugins.document_epub_render
kolibri.plugins.default_theme
- Running the devserver. You may wish to run the server so that you can do frontend development. I suggest the following changes to make this easier for you:
In the package.json
file in Kolibri, update all of the script entries that define a settings module to point to the kolibri_instant_schools_plugin.instant_schools_settings
rather than the kolibri.deployment.default.*.**
settings. Doing this will allow you to easily spin up the development server with hot reloading and you can run yarn run devserver
or yarn run devserver-hot
to start the full development server.
If you only need to work on Django backend and have the DJANGO_SETTINGS_MODULE
env variable set, then you can run yarn build
and kolibri start --foreground
.
If things aren't working, double and triple check that the user plugin is disabled and the instant_schools plugin is enabled in kolibri_settings.json
which is located in your KOLIBRI_HOME
folder.
- (Optional) - Copy the
kolibri_instant_schools_plugin/assets/src/views/about/views/about
to$(KOLIBRI_HOME)/content/databases
. Note that the about folders are indeed nested and that is not a typo.
- From the root of the
kolibri_instant_schools_plugin
project,cd kolibri_instant_schools_plugin/smpp/SMPPSim
- Now, unzip the file:
unzip SMPPSim.zip
which should create a new folderSMPPSim
- Now,
cd SMPPSim
and you can runsudo sh startsmppsim.sh
from that folder anytime to test SMPP.
This will start a server that will be used for the SMPP testing. You can see output of SMPP activity logged in the console where this is run.
If you are running nginx as a reverse proxy, you will need to ensure that the following headers are set so that the password reset generates the link with the proper host in the URL:
proxy_set_header X-Forwarded-Host $host; # allows django to determine the name/addr of the server that the client originally connected to (see request.get_host())
proxy_set_header X-Forwarded-Port $server_port; # same idea as above, but for port number (see request.get_port())
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Note that this may be incomplete. Typically, a plugin like this will be used within a released build of Kolibri so the following does not follow our expected typical use case.
-
Inside your Kolibri virtual environment:
pip install kolibri_instant_schools_plugin
-
Activate the plugin:
kolibri plugin kolibri_instant_schools_plugin enable
-
Restart Kolibri.
-
Follow the instructions above to installing the plugin for development.
-
Update
setup.py
to a newer version. -
In the terminal move to the root level of repo dir and run the following command to publish to PyPi:
make release
The Instant Schools plugin will look for an environment variable INSTANT_SCHOOLS_APP_TITLE
. If there is nothing set for that variable, the default title "Instant Schools" will be used.