Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 138 commits ahead of recalapp:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


ReCal is a course selection tool widely used at Princeton University.


Initial setup


Updating for a new semester

Make a new branch, e.g. sp-22 , then make the following changes to settings/ , landing, and status pages:

#11 (ignore README changes)

Test out on test-recal:

git remote add dev
git push dev sp-22:master
heroku run python course_selection_courses_init --app=test-recal
# heroku run python clear_cache --app=test-recal # not needed but may help

Test at If nothing breaks, merge sp-22 into master, which will auto-deploy to

Then, test on And bump number of dynos. Then send out emails.

Updating Buildpacks

If relying on the older Multipack Buildpack, which is now deprecated, update the buildpacks as present on the .buildpacks file:

heroku buildpacks:set -r dev
heroku buildpacks:add -r dev
heroku buildpacks:add -r dev
heroku buildpacks:add -r dev
heroku buildpacks:add -r dev

Switch -r dev with -r prod if changing the production buildpacks.


We will be using a rebase workflow. This is much easier for rollbacks, and since we are not open-sourced, we don't have to deal with pull requests.

Working on a New Feature

Use the following template.

git checkout -b fb1
# do your work here
# end of work
git fetch origin master:master # this is the same as `git checkout master && git pff && git checkout fb1`
git rebase -i master
git checkout master
git mff fb1

pull --ff-only and merge --ff-only

git pull does not always do the right thing, as it tries to merge. We never want merging, so I recommend adding the following aliases to your ~/.gitconfig:

    pff = pull --ff-only
    mff = merge --ff-only

What if I Can't Fast-Forward on Master?

# on master
git fetch
git rebase origin/master

Dev Environment Setup

Installing Prerequisites

Heroku Toolbelt

ReCal uses Heroku. For testing, it is recommended to use Heroku's Foreman, as opposed to using Django's built-in testing web server. To get Foreman, install Heroku Toolbelt.

Environmental Variable

Copy the file .env_example into .env and fill in the appropriate variable. Then, execute it as a Bash script, or to make things easier, use autoenv.


ReCal uses Postgres as its database. First, download Postgres. For Mac, the easiest thing is to install Create an empty database for use with ReCal. Django will take care of the rest.


We use PIP to keep track of our required packages. First, install PIP. Optionally, but recommended, use virtualenv to keep ReCal's PIP packages separate from your other projects. On a Mac, also install virtualenvwrapper, which exposes a nice command-line interface. When you have everything setup, run the following:

pip install -r requirements.txt

You may also need to install PDFtk manually in order to successfully run the command above. PDFtk is a dependency for parsing PDF files in python, which we use for generating course enrollment worksheets.

Initial Setup


We need to give django a chance to set up everything. To do that, run the script setup_database. Note that you must have your environmental variables set up correctly for this to work.

Static Assets

To install, compile, and collect static assets:

npm install

Running the Test Environment

Issue this command:

heroku local

You can now access the test environment at localhost:PORT, where PORT is the actual port number. By default, PORT is 5000.


Whenever you make changes to the static file, you must tell Django about it. To do that, run:

python collectstatic

If that fails, ignore the npm dependencies and run

python collectstatic -i node_modules


First a COS 333 project, now a very popular tool at Princeton for course selection.







No packages published


  • CSS 28.6%
  • Python 28.4%
  • TypeScript 21.8%
  • HTML 13.3%
  • JavaScript 4.8%
  • Less 2.8%
  • Other 0.3%