a-goetz / canvas-scheduler

Scheduling repeating events in canvas
MIT License
0 stars 0 forks source link

canvas-scheduler

Scheduling repeating events in canvas

Code Credits

Uses the this Flask LTI Template

Flask using Jinja

Real Python: an excellent tutorial

Planned future feature: Interactive calendar

React Big Calendar

MomentJS for use with Calendar.

Setup

Virtual Environment

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
bower install
npm install

Create your local settings file

Create settings.py from settings.py.template

cp project/settings.py.template project/settings.py

Note: settings.py is already referenced in the .gitignore and multiple python files, if you want a different settings file name be sure to update the references.

Add your values to the settings file.

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)

Run a Development Server

Here's how you run the flask app from the terminal:

export FLASK_APP=views.py
flask run

Open in a Browser

Your running server will be visible at http://127.0.0.1:5000

Install LTI in Canvas

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.