Skip to content
Patrick Michaud edited this page Oct 27, 2015 · 3 revisions

Prerequisites

A Python installation (2.7 or greater)
pip or easy_install
git

Step-by-step

If you don't have it already, install virtualenv:

$ pip install virtualenv

if you don't have pip, you may be able to:

$ easy_install virtualenv

 

Checkout the master of the canvas-analytics project:

$ git clone https://github.com/uw-it-aca/canvas-analytics.git

Turn canvas-analytics into a virtualenv:

$ virtualenv  canvas-analytics   

Activate your virtualenv:

cd canvas-analytics
source bin/activate

Install required Python packages with pip (make sure you have that period at the end):

$ pip install -r requirements.txt

Create a django project in the canvas-analytics dir:

$ django-admin.py startproject project .

That '.' at the end is important!

Modify at least the following settings in project/settings.py:
    INSTALLED_APPS
    (add: 'analytics')

$ python manage.py syncdb
$ python manage.py migrate

Configuring Canvas Access

Add the following to your project/settings.py file:

RESTCLIENTS_CANVAS_DAO_CLASS = 'restclients.dao_implementation.canvas.Live'     
RESTCLIENTS_CANVAS_HOST="https://canvas.uw.edu"     
RESTCLIENTS_CANVAS_OAUTH_BEARER="_your canvas oauth bearer token_"

You'll probably need to setup a ca-bundle file - there should probably be documentation about that.
RESTCLIENTS_CA_BUNDLE="/path/to/file/that-includes-the-right-ca-for-canvas"

This page documents how to get a token: https://canvas.instructure.com/doc/api/file.oauth.html

Configuring the courses

To configure the current term:

ANALYTICS_TERM_SIS_ID = "2015-autumn"                                           
# FirstDay                                                                      
ANALYTICS_TERM_START_DATE = "2015-09-30"                                        
# LastFinalExamDay                                                              
ANALYTICS_TERM_END_DATE = "2015-12-18"  

To configure the courses loaded:
ANALYTICS_SIS_COURSE_IDS = []
# A list like                                                                   
# ['2015-winter-TRAIN-101-A',                                                   
#  '2015-winter-TRAIN-101-B',                                                   
#  '2015-winter-TRAIN-201-A']  
Clone this wiki locally