Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Basic walkthrough

heoa edited this page Jul 29, 2012 · 7 revisions

Installation

git clone git://github.com/drsm79/situp.git
cd situp
export PYTHONPATH=$PYTHONPATH:$PWD
chmod u+x situp.py
export PATH=$PATH:$PWD

Optional dependencies (tbd):

Create a view

To create my_view in $PWD/_design/my_design run:

situp.py view -d my_design my_view

This produces a skeleton map.js and reduce.js in $PWD/_design/my_design/views/my_view/. If you want to use a built-in reduce (sum|count|stats) run:

situp.py view -d my_design my_view --count

Create some html pages

To create some empty html files that will be added to your design document as an attachment run:

situp.py html -d my_design --name=page1

This creates page1.html in $PWD/_design/my_design/_attachments/.

Install a vendor

Vendors are managed via kan.so packages. A vendor and it's dependencies are installed into $PWD/_design/my_design/vendor. For example, you could install backbone by running:

situp.py vendor -d my_design backbone

This assumes that you are going to make an application in a kan.so compatible manner. If you want to include some javascript that is either not available via kan.so packages or you don't want to follow the kan.so application pattern you can either manually put the js files in $PWD/_design/my_design/_attachments/ or clone the code into the vendor directory, e.g.:

cd _design/my_design/vendor/
git clone git://github.com/documentcloud/backbone.git

The latter is discouraged due to the deep-repo -problem i.e. you may lose your work in the deep repos. You can manually copy files into _attachments/js where you can manage things such as versions and deployment -names.

Pushing an application

To push the application into your CouchDB server run:

situp.py push -d my_design -e demo_app -s http://localhost:5984
Clone this wiki locally