Skip to content

mrjoshida/curriculumbuilder

 
 

Repository files navigation

Code.org CurriculumBuilder

An internal tool designed for Code.org curricula

How to use CurriculumBuilder

  • Go to the #curriculumbuilder-dev channel for support

How to install Curriculum Builder locally on OS X

  1. install mac os x dependencies
brew install openssl postgres heroku/brew/heroku Caskroom/cask/wkhtmltopdf
brew services start postgresql
  1. make sure you have python 2.7
python -V # -> Python 2.7.10

if you don't, try installing it:

brew install python@2

And then run python -V again to make sure you now have version 2.7 installed. If you don't, stop here and try to get yourself onto this version of python before proceeding.

  1. clone repo
git clone https://github.com/mrjoshida/curriculumbuilder.git
cd curriculumbuilder
  1. set up virtualenv (https://docs.python-guide.org/dev/virtualenvs/#lower-level-virtualenv)
pip install virtualenv
mkdir ~/.virtualenvs
virtualenv ~/.virtualenvs/cb
source ~/.virtualenvs/cb/bin/activate
  1. install python dependencies
pip install -r requirements.txt

if you are returning to this step to fix problems with pycurl, you may need to also add the --no-cache-dir flag.

  1. copy the db
heroku login # need credentials from Josh C.
heroku pg:pull DATABASE_URL curriculumbuilder -a curriculumbuilder
  1. set up local_settings.py
cp curriculumBuilder/local_settings.py.example curriculumBuilder/local_settings.py
  1. run the tests
npm install
./manage.py test
  1. run the server
source ~/.virtualenvs/cb/bin/activate # must be run once per shell window
debug=true python manage.py runserver_plus

http://localhost:8000

  1. troubleshooting pycurl

    There are two potential errors you can get which look very similar:

  1. measure test coverage
pip install -r requirements-dev.txt
DJANGO_SETTINGS_MODULE=curriculumBuilder.settings debug=true coverage run ./manage.py test
coverage report

If you run this often, it may be worth appending the --keepdb flag to make it run faster, and temporarily disabling any tests which fail as a result.

How to install Curriculum Builder locally on Ubuntu

These instructions are a work in progress.

  1. install dependencies
sudo apt-get install python-pip postgresql wkhtmltopdf 
# some of these may be unneccessary
sudo apt-get install libcurl4-openssl-dev libssl-dev postgresql-contrib
sudo snap install --classic heroku
  1. configure postgresql
sudo service postgresql start
sudo -u postgres psql
CREATE USER ubuntu;
ALTER USER ubuntu SUPERUSER CREATEDB;

at this point I got stuck:

(cb) ip-10-0-0-19:~/cb (master)$ heroku pg:pull DATABASE_URL curriculumbuilder -a curriculumbuilder
pg_dump: server version: 9.6.15; pg_dump version: 9.5.19
pg_dump: aborting because of server version mismatch
# dropdb curriculumbuilder # to backtrack and try again

How does the deploy work on CurriculumBuilder

CurriculumBuilder is actually two separate websites:

When you add a feature to CurriculumBuilder by merging a commit your change will automatically be deployed to codecurricula.com. You can watch the #curriculumbuilder channel to see when it gets deployed.

In order for your change to show up on curriculum.code.org all of the impacted curriculum must be republished. Developers should ask the curriculum team to republish their curriculum so that we don't accidentally ship a change to the curriculum that was not ready to go out.

Updating your local database schema

To update your local database schema use the following command:

./manage.py migrate

Updating your local database contents

dropdb curriculumbuilder
heroku pg:pull DATABASE_URL curriculumbuilder -a curriculumbuilder

Creating a new user

If you have an account and are a superuser, you can create new CurriculumBuilder users by doing the following:

  1. Log in at codecurricula.com/admin. Choose the "admin" interface.
  2. Choose the "Users" option in the left-hand navigation menu, or go to codecurricula.com/admin/auth/user/. Here, you can view, update, and create users.
  3. Use the "Add user" button to create a new user.
  4. Set the user's permissions:
  • All users need to have www.codecurricula.com added to their site permissions.
  • All staff members will need "staff status" set to true.
  • Curriculum writers need to be added to the "author" group.
  1. If you need this new user for local development purposes, update your local database contents.

About

Curriculum Builder in development for writing sweet K-12 CS curriculum

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 43.7%
  • Python 26.1%
  • JavaScript 24.4%
  • CSS 5.5%
  • Shell 0.3%