LTI template written in Python using the Flask framework. Quickly create a new application that can be launched through your Learning Management System using the LTI protocol. Uses standard configurable Key & Secret to launch.
Create a virtual environment that uses Python 2:
virtualenv venv -p /usr/bin/python2.7
source venv/bin/activate
Install the dependencies from the requirements file.
pip install -r requirements.txt
Create settings.py from settings.py.template
cp settings.py.template settings.py
Note: settings.py is alreay referenced in the .gitignore and multiple python files, if you want a different settings file name be sure to update the references.
At a minimum, CONSUMER_KEY, SHARED_SECRET, and secret_key need to be input by the developer. The secret_key is used by Flask, but the CONSUMER_KEY and SHARED_SECRET will be used in setting up the LTI. For security purposes, it's best to have randomized keys. You can generate random keys in the command line by using os.urandom(24) and inputing the resulting values into the settings.py file:
import os
os.urandom(24)
Here's how you run the flask app from the terminal:
export FLASK_APP=views.py
flask run
Your running server will be visible at http://127.0.0.1:5000
Note: If you're using Canvas, your version might be finicky about SSL certificates. Keep HTTP/HTTPS in mind when creating your XML and while developing your project. Some browsers will disable non-SSL LTI content until you enable it through clicking a shield in the browser bar or something similar.