- python-dev
- virtualenv
- Install python dependencies
virtualenv .virtualenv
. .virtualenv/bin/activate
pip install -r requirements/base.txt
- Create
app/local_settings.py
, and set the sensitive settings.
SECRET_KEY = 'SET ME'
LTI_CLIENT_KEY = 'SET ME'
LTI_CLIENT_SECRET = 'SET ME'
PASSWORD_GENERATOR_NONCE = 'SET ME'
# Optional - can use default sqlite for dev
HAIKU_DB_PASSWORD = 'SET ME'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'lti_haiku',
'USER': 'lti_haiku',
'PASSWORD': HAIKU_DB_PASSWORD,
}
}
You can use the following script to generate secret keys:
#!/usr/bin/env python
import string
from django.utils.crypto import get_random_string
get_random_string(64, string.hexdigits)
- Initialize app: install dependencies, database, static files, and create a superuser.
./manage.py migrate
./manage.py createsuperuser
- Run server
# Use port 8080 to avoid conflicting with LMS/CMS ports
./manage.py runserver 8080
- Run tests, and view coverage report
pip install -r requirements/test.txt
coverage run --source=. manage.py test
coverage report -m