Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
87 lines (65 sloc) 3.62 KB


Basis for creating new Knight Lab-themed documentation or static sites. To use:

Install Cactus

If you haven't, create a virtual environment for doing cactus projects. While we don't have a lot of experience, it seems you could get away with a single environment for all cactus-based sites.

NOTE: the changes which allow Cactus to use KnightLab-specific templates have not yet been merged into the original Cactus project, so you must use the special pip install command below.

mkvirtualenv cactussites
pip install -e git://

You're now ready. See below for guidance on starting a new site.

Start a new site

In a terminal:

workon cactussites
cd ~/src (or whereever you keep your git repositories)
cactus create **** --skeleton=
cactus serve

You're now looking at your site. Have fun!

Add your new site to GitHub

First, create the git repository where the site will live.

  • Go to
  • Choose "NUKnightLab" from the "owner" menu
  • For the repository name, use the fully-qualified domain name of the site (e.g.
  • Check "Public"
  • Uncheck "Initialize this repository with a README"

In a terminal:

cd ~/src/
git init
git add .
git commit -m "initial"
git remote add origin****.git
git push -u origin master

Deploying the site to S3

Cactus makes this dead simple. The first time you do it, it will ask for the Amazon access key and secret key. You can find these values in the Access Credentials section of our AWS console.

$ cactus deploy
Plugins: version
Building error.html
Building index.html
Building robots.txt
Building sitemap.xml
Amazon access key ( 
Amazon secret access key (will be saved in keychain): 
S3 bucket name ( ****
Bucket does not exist, create it? (y/n): y
Bucket was selected with website endpoint
You can learn more about s3 (like pointing to your own domain) here:
Uploading site to bucket

If this is the first time you are deploying the site, you will also need to set up a DNS CNAME to make the public domain name map to the Amazon S3 bucket.

Notes on installing virtualenv

These are for Macintosh/Linux. Feel free to submit a pull-request with notes for Windows

If you don't have easy_install installed, then do that. If you do have pip installed, skip the first line. easy_install pip pip install virtualenv pip install virtualenvwrapper

Create or edit /.profile ( means your home directory) add these lines. If you keep git repositories in a specific place, you may want to change PROJECT_HOME to point to that, but don't worry too much about it.

export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/

Open a new terminal to activate the virtual environment

Note: sometimes gets installed in a different path. If it did, you'll get an error when you open a new terminal. Ask for help finding your