Lightweight client for Moodle REST web services
- Linux/Windows
- Python 3.6
- MySQL
Login to your moodle, go to Site administration -> Plugins -> Web services -> Overview
and follow the instructions to enable web services and generate authorization token. Make sure to check the following while going through this process:
- Activate REST protocol
- Assign a service to the token which has all the functions. So that, call of any capability can get response from your moodle.
-
Clone the git repository.
-
Install the dependent libraries (packages) from requirements.txt.
-
Make sure that MySQL Server is up and running with the following credentials: If you want the plugin to adapt MySQL server settings of your own then setup your credentials in moodle-middleware/local_settings.py
host = "127.0.0.1" database = "moodle-middleware" user = "root" pass = ""
-
Deploy the sql file moodle-middleware/database/moodle-middleware.sql on MySQL Server to create moodle table in the database.
-
Run the plugin:
-
Windows
python main.py
- App runs on Flask Server at "http://localhost:5000"
- For Development Puspose only!
-
Linux
./start.sh
- App runs on Gunicorn Server at "http://localhost:5001"
-
Refer to this documentation for api calls.